Commit e8b984e6 authored by Eugenia Grieff's avatar Eugenia Grieff

Use access levels instead of new conditions

parent 11c57abb
...@@ -77,6 +77,7 @@ class GroupPolicy < BasePolicy ...@@ -77,6 +77,7 @@ class GroupPolicy < BasePolicy
end end
rule { maintainer }.policy do rule { maintainer }.policy do
enable :maintainer_access
enable :create_projects enable :create_projects
enable :admin_pipeline enable :admin_pipeline
enable :admin_build enable :admin_build
...@@ -88,6 +89,7 @@ class GroupPolicy < BasePolicy ...@@ -88,6 +89,7 @@ class GroupPolicy < BasePolicy
end end
rule { owner }.policy do rule { owner }.policy do
enable :owner_access
enable :admin_group enable :admin_group
enable :admin_namespace enable :admin_namespace
enable :admin_group_member enable :admin_group_member
......
...@@ -3,9 +3,6 @@ ...@@ -3,9 +3,6 @@
class EpicPolicy < BasePolicy class EpicPolicy < BasePolicy
delegate { @subject.group } delegate { @subject.group }
condition(:maintainer) { @subject.group.has_maintainer?(@user) }
condition(:owner) { @subject.group.has_owner?(@user) }
rule { can?(:read_epic) }.policy do rule { can?(:read_epic) }.policy do
enable :read_epic_iid enable :read_epic_iid
enable :read_note enable :read_note
...@@ -17,5 +14,5 @@ class EpicPolicy < BasePolicy ...@@ -17,5 +14,5 @@ class EpicPolicy < BasePolicy
rule { can?(:create_note) }.enable :award_emoji rule { can?(:create_note) }.enable :award_emoji
rule { maintainer | owner }.enable :admin_note rule { can?(:owner_access) | can?(:maintainer_access) }.enable :admin_note
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment