Remove unnecessary runner.is_shared? checks in api because they are handled by policy

This commit is contained in:
Dylan Griffith 2018-05-11 10:56:02 +02:00
parent b35d16a77f
commit 983bc6b175
1 changed files with 0 additions and 2 deletions

View File

@ -190,14 +190,12 @@ module API
def authenticate_update_runner!(runner)
return if current_user.admin?
forbidden!("Runner is shared") if runner.is_shared?
forbidden!("No access granted") unless can?(current_user, :update_runner, runner)
end
def authenticate_delete_runner!(runner)
return if current_user.admin?
forbidden!("Runner is shared") if runner.is_shared?
forbidden!("Runner associated with more than one project") if runner.projects.count > 1
forbidden!("No access granted") unless can?(current_user, :delete_runner, runner)
end