diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-30 21:09:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-30 21:09:52 +0300 |
commit | 6010cf135a52a37b200112fa353900a690f958a7 (patch) | |
tree | 74b0ab61b564ea9fa47099fb85cf888add5405e7 /app/services/resource_access_tokens | |
parent | dd240e5cc4e0abc4eef8b97962c247dab43e3777 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/services/resource_access_tokens')
-rw-r--r-- | app/services/resource_access_tokens/create_service.rb | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/app/services/resource_access_tokens/create_service.rb b/app/services/resource_access_tokens/create_service.rb index c253154c1b7..4ff8973773d 100644 --- a/app/services/resource_access_tokens/create_service.rb +++ b/app/services/resource_access_tokens/create_service.rb @@ -32,20 +32,11 @@ module ResourceAccessTokens attr_reader :resource_type, :resource def feature_enabled? - return false if ::Gitlab.com? - - ::Feature.enabled?(:resource_access_token, resource, default_enabled: true) + return true unless ::Gitlab.com? end def has_permission_to_create? - case resource_type - when 'project' - can?(current_user, :admin_project, resource) - when 'group' - can?(current_user, :admin_group, resource) - else - false - end + %w(project group).include?(resource_type) && can?(current_user, :admin_resource_access_tokens, resource) end def create_user |