summaryrefslogtreecommitdiff
path: root/app/policies/group_member_policy.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/policies/group_member_policy.rb')
-rw-r--r--app/policies/group_member_policy.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/policies/group_member_policy.rb b/app/policies/group_member_policy.rb
index f6e52def270..78a2be7a9f8 100644
--- a/app/policies/group_member_policy.rb
+++ b/app/policies/group_member_policy.rb
@@ -11,7 +11,10 @@ class GroupMemberPolicy < BasePolicy
condition(:is_target_user) { @user && @subject.user_id == @user.id }
rule { anonymous }.prevent_all
- rule { last_owner }.prevent_all
+ rule { last_owner }.policy do
+ prevent :update_group_member
+ prevent :destroy_group_member
+ end
rule { can?(:admin_group_member) }.policy do
enable :update_group_member