Class: ActiveAdmin::CanCanAdapter
Instance Attribute Summary
#resource, #user
Instance Method Summary
collapse
#initialize
Instance Method Details
#authorized?(action, subject = nil) ⇒ Boolean
14
15
16
|
# File 'lib/active_admin/cancan_adapter.rb', line 14
def authorized?(action, subject = nil)
cancan_ability.can?(action, subject)
end
|
#cancan_ability ⇒ Object
18
19
20
|
# File 'lib/active_admin/cancan_adapter.rb', line 18
def cancan_ability
@cancan_ability ||= initialize_cancan_ability
end
|
#scope_collection(collection, action = ActiveAdmin::Auth::READ) ⇒ Object
22
23
24
|
# File 'lib/active_admin/cancan_adapter.rb', line 22
def scope_collection(collection, action = ActiveAdmin::Auth::READ)
collection.accessible_by(cancan_ability, action)
end
|