diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-07 21:09:16 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-12-07 21:09:16 +0300 |
commit | 38e6d9291369e346f33f52a5ab656b787ce0a2c0 (patch) | |
tree | c5137121d6cc0ff5d9372252569c10a05164b794 /app/models/members | |
parent | 2a501f63df96252295df7efe53880c5e78fa22b5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/members')
-rw-r--r-- | app/models/members/group_member.rb | 6 | ||||
-rw-r--r-- | app/models/members/project_member.rb | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/app/models/members/group_member.rb b/app/models/members/group_member.rb index ad1ad1e74fe..796b05b7fff 100644 --- a/app/models/members/group_member.rb +++ b/app/models/members/group_member.rb @@ -55,6 +55,12 @@ class GroupMember < Member { group: group } end + def last_owner_of_the_group? + return false unless access_level == Gitlab::Access::OWNER + + group.member_last_owner?(self) || group.member_last_blocked_owner?(self) + end + private override :refresh_member_authorized_projects diff --git a/app/models/members/project_member.rb b/app/models/members/project_member.rb index 1099e0f48c0..6aa6afb595d 100644 --- a/app/models/members/project_member.rb +++ b/app/models/members/project_member.rb @@ -96,6 +96,10 @@ class ProjectMember < Member { project: project } end + def holder_of_the_personal_namespace? + project.personal_namespace_holder?(user) + end + private override :access_level_inclusion |