Sha256: 4cb5023ff1539ce5f16c8553f85b67d0a3339280ad2ed63297fc34b97270d417
Contents?: true
Size: 554 Bytes
Versions: 18
Compression:
Stored size: 554 Bytes
Contents
require 'cancan' module RailsOps::AuthorizationBackend class CanCanCan < Abstract EXCEPTION_CLASS = 'CanCan::AccessDenied'.freeze 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
18 entries across 18 versions & 1 rubygems