diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-06-18 21:22:34 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-06-18 21:22:34 +0300 |
commit | 439f399bece8c2b01dc064b6c02f28fb4149595e (patch) | |
tree | 1862fa39f76a9c8941f5120ba7af5fc3d5f91124 /app/models/ability.rb | |
parent | 670aaaeb9db7902c8776cb7754ac8fd1e7a606a1 (diff) | |
download | gitlab-ce-439f399bece8c2b01dc064b6c02f28fb4149595e.tar.gz |
Remove all team resources except models. Move models to deprecated directory
Diffstat (limited to 'app/models/ability.rb')
-rw-r--r-- | app/models/ability.rb | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/app/models/ability.rb b/app/models/ability.rb index 70a4435e699..7e8d14ab10d 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -11,7 +11,6 @@ class Ability when "PersonalSnippet" then personal_snippet_abilities(user, subject) when "MergeRequest" then merge_request_abilities(user, subject) when "Group", "Namespace" then group_abilities(user, subject) - when "UserTeam" then user_team_abilities(user, subject) else [] end.concat(global_abilities(user)) end @@ -19,7 +18,6 @@ class Ability def global_abilities(user) rules = [] rules << :create_group if user.can_create_group - rules << :create_team if user.can_create_team rules end @@ -146,21 +144,6 @@ class Ability rules.flatten end - def user_team_abilities user, team - rules = [] - - # Only group owner and administrators can manage team - if user.admin? || team.owner == user || team.admin?(user) - rules << [ :manage_user_team ] - end - - if team.owner == user || user.admin? - rules << [ :admin_user_team ] - end - - rules.flatten - end - [:issue, :note, :project_snippet, :personal_snippet, :merge_request].each do |name| define_method "#{name}_abilities" do |user, subject| if subject.author == user |