diff options
author | http://jneen.net/ <jneen@jneen.net> | 2016-08-16 16:29:10 -0700 |
---|---|---|
committer | http://jneen.net/ <jneen@jneen.net> | 2016-08-30 11:39:22 -0700 |
commit | 2944022835d872b472d8691082ef67aa3057d2b4 (patch) | |
tree | 5606008f210f7c006761b9cf7d5e8921388fae53 /app/models/ability.rb | |
parent | ccfa032ebc101339c1c0842d0fbeb5b555db9278 (diff) | |
download | gitlab-ce-2944022835d872b472d8691082ef67aa3057d2b4.tar.gz |
trim more dead code
Diffstat (limited to 'app/models/ability.rb')
-rw-r--r-- | app/models/ability.rb | 53 |
1 files changed, 1 insertions, 52 deletions
diff --git a/app/models/ability.rb b/app/models/ability.rb index 2360bf3d46c..794fb1223e3 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -96,57 +96,6 @@ class Ability end end - def anonymous_project_abilities(subject) - project = if subject.is_a?(Project) - subject - else - subject.project - end - - if project && project.public? - rules = [ - :read_project, - :read_board, - :read_list, - :read_wiki, - :read_label, - :read_milestone, - :read_project_snippet, - :read_project_member, - :read_merge_request, - :read_note, - :read_pipeline, - :read_commit_status, - :read_container_image, - :download_code - ] - - # Allow to read builds by anonymous user if guests are allowed - rules << :read_build if project.public_builds? - - # Allow to read issues by anonymous user if issue is not confidential - rules << :read_issue unless subject.is_a?(Issue) && subject.confidential? - - rules - project_disabled_features_rules(project) - else - [] - end - end - - def anonymous_group_abilities(subject) - rules = [] - - group = if subject.is_a?(Group) - subject - else - subject.group - end - - rules << :read_group if group.public? - - rules - end - def anonymous_user_abilities [:read_user] unless restricted_public_level? end @@ -211,7 +160,7 @@ class Ability project = subject.project unless target_user == project.owner - can_manage = project_abilities(user, project).include?(:admin_project_member) + can_manage = allowed?(user, :admin_project_member, project) if can_manage rules << :update_project_member |