Sha256: bc4a924c19f18f23922244470e38c93f2a46e3a7694cd5fb98510bbdfd6c5e1f
Contents?: true
Size: 502 Bytes
Versions: 13
Compression:
Stored size: 502 Bytes
Contents
class Ability include CanCan::Ability def initialize(user) can :read, :all return cannot :read, User unless user user ||= User.new case user.role_id when Role::SUPER can :manage, :all when Role::ADMIN can :manage, :all when Role::USER can :manage, Gallery, :user_id => user.id can :manage, Blog, :user_id => user.id can :edit, Profile, :user_id => user.id cannot :read, User end can :read, :all end end
Version data entries
13 entries across 13 versions & 1 rubygems