Skip to content

Rename User#has_paid_namespace? method to better reflect intention

What does this MR do and why?

First step in resolving https://gitlab.com/gitlab-org/gitlab/-/issues/416651+.

Rename User#has_paid_namespace? to User#belongs_to_paid_namespace? in the User model. This clarifies that the paid namespaces do not belong to the user, rather it's the other way around. Therefore there's no expectation that the user has any ownership or management rights over the namespaces the method returns.

Also, make the User#paid_namespaces method private, for two reasons:

  1. The method currently does not account for all paid namespaces a user is a member of - only direct memberships.
  2. Only User#belongs_to_paid_namespace? relies on that method, and there's no reason to keep User#paid_namespaces public right now as it's not used.

Screenshots or screen recordings

No visual changes.

How to set up and validate locally

No functional or visual changes. All tests should continue to pass.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports