Remove unnecessary runner.is_shared? checks in api because they are handled by policy
This commit is contained in:
parent
b35d16a77f
commit
983bc6b175
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue