Sha256: 4fcfbf9f256814b7a9dd336266d1586c9a990362e416c176420d79c7caeb5cac

Contents?: true

Size: 467 Bytes

Versions: 35

Compression:

Stored size: 467 Bytes

Contents

module RailsOps::AuthorizationBackend
  class CanCanCan < Abstract
    def initialize
      unless defined?(CanCanCan)
        fail "RailsOps is configured to use CanCanCan authorization backend, but the Gem 'cancancan' does not appear to be installed."
      end
    end

    def authorize!(operation, *args)
      ability = operation.context.try(:ability) || fail(RailsOps::Exceptions::AuthorizationNotPerformable)
      ability.authorize!(*args)
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
rails_ops-1.0.0.beta15 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.0.beta14 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.0.beta13 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.0.beta12 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.0.beta11 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.0.beta10 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.0.beta9 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.0.beta8 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.0.beta7 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.0.beta6 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.0.beta5 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.0.beta4 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.0.beta3 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.0.beta2 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.0.beta1 lib/rails_ops/authorization_backend/can_can_can.rb