Commit e515725c authored by Robert Speicher's avatar Robert Speicher

Merge branch 'extract-ee-specific-code-from-group_member_policy' into 'master'

Extract EE-specific code from GroupMemberPolicy

See merge request gitlab-org/gitlab-ee!8907
parents 7f6f4410 2e795bd5
......@@ -21,12 +21,6 @@ class GroupMemberPolicy < BasePolicy
rule { is_target_user }.policy do
enable :destroy_group_member
end
## EE extensions
condition(:ldap, score: 0) { @subject.ldap? }
condition(:override, score: 0) { @subject.override? }
rule { ~ldap }.prevent :override_group_member
rule { ldap & ~override }.prevent :update_group_member
end
GroupMemberPolicy.prepend(EE::GroupMemberPolicy)
# frozen_string_literal: true
module EE
module GroupMemberPolicy
extend ActiveSupport::Concern
prepended do
condition(:ldap, score: 0) { @subject.ldap? }
condition(:override, score: 0) { @subject.override? }
rule { ~ldap }.prevent :override_group_member
rule { ldap & ~override }.prevent :update_group_member
end
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