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