Sha256: 231f4734ff89e46da1c89d47d0151b87a930aae7f4ded258d0203bbedbe086e1
Contents?: true
Size: 757 Bytes
Versions: 14
Compression:
Stored size: 757 Bytes
Contents
# Application's CanCan ability class. Engines will include their ability classes #------------------------------------------------------------------------------ class Ability include CanCan::Ability include DmCore::Concerns::Ability @@registered_abilities = [] #------------------------------------------------------------------------------ def initialize(user) @user_roles = user.roles.all if user @@registered_abilities.each {|method| self.send method, user} dm_core_abilities(user) end # allows an engine to register it's ability method #------------------------------------------------------------------------------ def self.register_abilities(method_name) @@registered_abilities << method_name end end
Version data entries
14 entries across 14 versions & 1 rubygems