Backport hooks on group policies for the EE-specific implementation

This commit is contained in:
Douglas Barbosa Alexandre 2016-12-13 11:51:09 -02:00
parent 0d04db92ef
commit 8c639ac23c
2 changed files with 12 additions and 0 deletions

View file

@ -15,5 +15,11 @@ class GroupMemberPolicy < BasePolicy
elsif @user == target_user
can! :destroy_group_member
end
additional_rules!
end
def additional_rules!
# This is meant to be overriden in EE
end
end

View file

@ -33,6 +33,8 @@ class GroupPolicy < BasePolicy
if globally_viewable && @subject.request_access_enabled && !member
can! :request_access
end
additional_rules!(master)
end
def can_read_group?
@ -43,4 +45,8 @@ class GroupPolicy < BasePolicy
GroupProjectsFinder.new(@subject).execute(@user).any?
end
def additional_rules!(master)
# This is meant to be overriden in EE
end
end