Class: Namespaces::Projects::InvitedGroupsFinder
- Inherits:
-
Object
- Object
- Namespaces::Projects::InvitedGroupsFinder
- Includes:
- Gitlab::Allowable, GroupsFilter
- Defined in:
- app/finders/namespaces/projects/invited_groups_finder.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(project, current_user = nil, params = {}) ⇒ InvitedGroupsFinder
constructor
A new instance of InvitedGroupsFinder.
Methods included from Gitlab::Allowable
Constructor Details
#initialize(project, current_user = nil, params = {}) ⇒ InvitedGroupsFinder
Returns a new instance of InvitedGroupsFinder.
20 21 22 23 24 |
# File 'app/finders/namespaces/projects/invited_groups_finder.rb', line 20 def initialize(project, current_user = nil, params = {}) @project = project @current_user = current_user @params = params end |
Instance Method Details
#execute ⇒ Object
26 27 28 29 30 31 32 |
# File 'app/finders/namespaces/projects/invited_groups_finder.rb', line 26 def execute return Group.none unless can?(current_user, :read_project, project) groups = group_links(include_relations).public_or_visible_to_user(current_user) groups = apply_filters(groups) sort(groups).with_route end |