Method: CanCan::Ability#permissions
- Defined in:
- lib/cancan/ability.rb
#permissions ⇒ Object
Return a hash of permissions for the user in the format of:
{
can: can_hash,
cannot: cannot_hash
}
Where can_hash and cannot_hash are formatted thusly:
{
action: { subject: [attributes] }
}
266 267 268 269 270 271 272 273 |
# File 'lib/cancan/ability.rb', line 266 def = { can: Hash.new { |actions, k1| actions[k1] = Hash.new { |subjects, k2| subjects[k2] = [] } }, cannot: Hash.new { |actions, k1| actions[k1] = Hash.new { |subjects, k2| subjects[k2] = [] } } } rules.each { |rule| (, rule) } end |