diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-26 21:19:16 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-04-26 21:19:16 +0300 |
commit | fa69a57b46f4893c488445f79d6d290463820f7d (patch) | |
tree | 4a73ccd1f8ffb4dbb47a42c6edb309238828a44e /app/graphql/types | |
parent | 34283a71d9ac31eb4da0b59d0b25fc2be014bc9c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/graphql/types')
-rw-r--r-- | app/graphql/types/ci/runner_type.rb | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/app/graphql/types/ci/runner_type.rb b/app/graphql/types/ci/runner_type.rb index 6367847a5a5..8e509cc8493 100644 --- a/app/graphql/types/ci/runner_type.rb +++ b/app/graphql/types/ci/runner_type.rb @@ -151,7 +151,7 @@ module Types end def ephemeral_register_url - return unless ephemeral_register_url_access_allowed?(runner) + return unless context[:current_user]&.can?(:read_ephemeral_token, runner) && runner.registration_available? case runner.runner_type when 'instance_type' @@ -203,23 +203,6 @@ module Types def can_admin_runners? context[:current_user]&.can_admin_all_resources? end - - def ephemeral_register_url_access_allowed?(runner) - return unless runner.registration_available? - - case runner.runner_type - when 'instance_type' - can_admin_runners? - when 'group_type' - group = runner.groups[0] - - group && context[:current_user]&.can?(:register_group_runners, group) - when 'project_type' - project = runner.projects[0] - - project && context[:current_user]&.can?(:register_project_runners, project) - end - end end end end |