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.17.1 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.19 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.18 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.17 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.16 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.15 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.14 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.13 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.12 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.11 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.10 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.9 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.7 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.6 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.5 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.4 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.3 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.2 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.1 lib/rails_ops/authorization_backend/can_can_can.rb
rails_ops-1.0.0 lib/rails_ops/authorization_backend/can_can_can.rb