Class: Gitlab::ProjectAuthorizations
- Inherits:
-
Object
- Object
- Gitlab::ProjectAuthorizations
- Defined in:
- lib/gitlab/project_authorizations.rb
Instance Attribute Summary collapse
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #calculate ⇒ Object
-
#initialize(user) ⇒ ProjectAuthorizations
constructor
user - The User object for which to calculate the authorizations.
Constructor Details
#initialize(user) ⇒ ProjectAuthorizations
user - The User object for which to calculate the authorizations.
10 11 12 |
# File 'lib/gitlab/project_authorizations.rb', line 10 def initialize(user) @user = user end |
Instance Attribute Details
#user ⇒ Object (readonly)
Returns the value of attribute user.
7 8 9 |
# File 'lib/gitlab/project_authorizations.rb', line 7 def user @user end |
Instance Method Details
#calculate ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/gitlab/project_authorizations.rb', line 14 def calculate cte = recursive_cte cte_alias = cte.table.alias(Group.table_name) ProjectAuthorization .unscoped .with .recursive(cte.to_arel) .select_from_union(relations(cte_alias: cte_alias)) end |