Module: Bosh::Director::Api::Controllers::DeploymentsSecurity
- Defined in:
- lib/bosh/director/api/controllers/deployments_controller.rb
Instance Method Summary collapse
Instance Method Details
#authorization(perm) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/bosh/director/api/controllers/deployments_controller.rb', line 12 def (perm) return unless perm condition do subject = :director = perm if :diff == begin @deployment = Bosh::Director::Api::DeploymentLookup.new.by_name(params[:deployment]) subject = @deployment = :admin rescue DeploymentNotFound = :create_deployment end else if params.has_key?('deployment') @deployment = Bosh::Director::Api::DeploymentLookup.new.by_name(params[:deployment]) subject = @deployment end end @permission_authorizer.granted_or_raise(subject, , token_scopes) end end |
#route(verb, path, options = {}, &block) ⇒ Object
6 7 8 9 10 |
# File 'lib/bosh/director/api/controllers/deployments_controller.rb', line 6 def route(verb, path, = {}, &block) [:scope] ||= :authorization [:authorization] ||= :admin super(verb, path, , &block) end |