gitlab-org--gitlab-foss/app/policies/deploy_key_policy.rb
2017-06-02 19:44:36 +03:00

11 lines
244 B
Ruby

class DeployKeyPolicy < BasePolicy
def rules
return unless @user
can! :update_deploy_key if @user.admin?
if @subject.private? && @user.project_deploy_keys.exists?(id: @subject.id)
can! :update_deploy_key
end
end
end