diff options
Diffstat (limited to 'app/services/members/approve_access_request_service.rb')
-rw-r--r-- | app/services/members/approve_access_request_service.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/app/services/members/approve_access_request_service.rb b/app/services/members/approve_access_request_service.rb index 5337279f702..51f9492ec91 100644 --- a/app/services/members/approve_access_request_service.rb +++ b/app/services/members/approve_access_request_service.rb @@ -16,7 +16,7 @@ module Members private def validate_access!(access_requester) - raise Gitlab::Access::AccessDeniedError unless can_update_access_requester?(access_requester) + raise Gitlab::Access::AccessDeniedError unless can_approve_access_requester?(access_requester) if approving_member_with_owner_access_level?(access_requester) && cannot_assign_owner_responsibilities_to_member_in_project?(access_requester) @@ -24,8 +24,8 @@ module Members end end - def can_update_access_requester?(access_requester) - can?(current_user, update_member_permission(access_requester), access_requester) + def can_approve_access_requester?(access_requester) + can?(current_user, :admin_member_access_request, access_requester.source) end def approving_member_with_owner_access_level?(access_requester) |