summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-09-22 11:11:33 +0200
committerRémy Coutable <remy@rymai.me>2016-09-22 11:12:18 +0200
commit94edafdf09fdc36054dcc3a71b34649a48c2a357 (patch)
tree736088284306ebcc842f5c6e5d245f801cef6ec6
parent690d19db1eaeb56ade5debd5305a15f73813ec51 (diff)
downloadgitlab-ce-94edafdf09fdc36054dcc3a71b34649a48c2a357.tar.gz
Inverse condition in Members::RequestAccessService
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r--app/services/members/request_access_service.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/services/members/request_access_service.rb b/app/services/members/request_access_service.rb
index 5c0d2d83445..2614153d900 100644
--- a/app/services/members/request_access_service.rb
+++ b/app/services/members/request_access_service.rb
@@ -8,7 +8,7 @@ module Members
end
def execute
- raise Gitlab::Access::AccessDeniedError if cannot_request_access?(source)
+ raise Gitlab::Access::AccessDeniedError unless can_request_access?(source)
source.members.create(
access_level: Gitlab::Access::DEVELOPER,
@@ -18,8 +18,8 @@ module Members
private
- def cannot_request_access?(source)
- !source || !can?(current_user, :request_access, source)
+ def can_request_access?(source)
+ source && can?(current_user, :request_access, source)
end
end
end