diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-06 12:08:29 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-04-06 12:08:29 +0000 |
commit | 39c98649d20e08428f507e0728b0bd87a299e5cf (patch) | |
tree | 6ca0ae12d9498f9158b7f8da9bad97f1517b0d83 /app/policies | |
parent | c16b752f86f78442349b7b2cd9106109de10763b (diff) | |
download | gitlab-ce-39c98649d20e08428f507e0728b0bd87a299e5cf.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/policies')
-rw-r--r-- | app/policies/project_member_policy.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/policies/project_member_policy.rb b/app/policies/project_member_policy.rb index 91f1eb35506..40ba30fce5e 100644 --- a/app/policies/project_member_policy.rb +++ b/app/policies/project_member_policy.rb @@ -3,13 +3,16 @@ class ProjectMemberPolicy < BasePolicy delegate { @subject.project } - condition(:target_is_owner, scope: :subject) { @subject.user == @subject.project.owner } + condition(:target_is_holder_of_the_personal_namespace, scope: :subject) do + @subject.project.personal_namespace_holder?(@subject.user) + end + condition(:target_is_self) { @user && @subject.user == @user } condition(:project_bot) { @subject.user&.project_bot? } rule { anonymous }.prevent_all - rule { target_is_owner }.policy do + rule { target_is_holder_of_the_personal_namespace }.policy do prevent :update_project_member prevent :destroy_project_member end |