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