summaryrefslogtreecommitdiff
path: root/app/models/group.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/group.rb')
-rw-r--r--app/models/group.rb22
1 files changed, 10 insertions, 12 deletions
diff --git a/app/models/group.rb b/app/models/group.rb
index b0392774379..ddebaff50b0 100644
--- a/app/models/group.rb
+++ b/app/models/group.rb
@@ -39,8 +39,6 @@ class Group < Namespace
has_many :boards
has_many :badges, class_name: 'GroupBadge'
- has_many :todos
-
accepts_nested_attributes_for :variables, allow_destroy: true
validate :visibility_level_allowed_by_projects
@@ -84,12 +82,6 @@ class Group < Namespace
where(id: user.authorized_groups.select(:id).reorder(nil))
end
- def public_or_visible_to_user(user)
- where('id IN (?) OR namespaces.visibility_level IN (?)',
- user.authorized_groups.select(:id),
- Gitlab::VisibilityLevel.levels_for_user(user))
- end
-
def select_for_project_authorization
if current_scope.joins_values.include?(:shared_projects)
joins('INNER JOIN namespaces project_namespace ON project_namespace.id = projects.namespace_id')
@@ -186,10 +178,13 @@ class Group < Namespace
add_user(user, :developer, current_user: current_user)
end
- def add_master(user, current_user = nil)
- add_user(user, :master, current_user: current_user)
+ def add_maintainer(user, current_user = nil)
+ add_user(user, :maintainer, current_user: current_user)
end
+ # @deprecated
+ alias_method :add_master, :add_maintainer
+
def add_owner(user, current_user = nil)
add_user(user, :owner, current_user: current_user)
end
@@ -206,12 +201,15 @@ class Group < Namespace
members_with_parents.owners.where(user_id: user).any?
end
- def has_master?(user)
+ def has_maintainer?(user)
return false unless user
- members_with_parents.masters.where(user_id: user).any?
+ members_with_parents.maintainers.where(user_id: user).any?
end
+ # @deprecated
+ alias_method :has_master?, :has_maintainer?
+
# Check if user is a last owner of the group.
# Parent owners are ignored for nested groups.
def last_owner?(user)