2021-09-30 23:02:18 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Members
|
|
|
|
module Projects
|
|
|
|
class CreatorService < Members::CreatorService
|
|
|
|
def self.access_levels
|
2022-05-07 20:08:51 +05:30
|
|
|
Gitlab::Access.sym_options_with_owner
|
2021-09-30 23:02:18 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def can_update_member?
|
|
|
|
super || current_user.can?(:update_project_member, member) || adding_a_new_owner?
|
|
|
|
end
|
|
|
|
|
|
|
|
def adding_a_new_owner?
|
|
|
|
# this condition is reached during testing setup a lot due to use of `.add_user`
|
|
|
|
member.owner? && member.new_record?
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|