Sha256: efc4be05facdbffa007c99a20355b713e7b8747282cc1c819a4a3d00b44bff78
Contents?: true
Size: 426 Bytes
Versions: 15
Compression:
Stored size: 426 Bytes
Contents
class Ability include CanCan::Ability def initialize(user) case user.try(:role).try(:name) when 'Administrator' can [:read, :create, :update], Manifestation when 'Librarian' can [:read, :create, :update], Manifestation when 'User' can :read, Manifestation do |manifestation| manifestation.required_role_id <= 2 end else can :read, Manifestation end end end
Version data entries
15 entries across 15 versions & 1 rubygems