Class: Para::Acl::Ability

Inherits:
Object
  • Object
show all
Includes:
CanCan::Ability
Defined in:
lib/para/acl/ability.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user) ⇒ Ability

Returns a new instance of Ability.



8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/para/acl/ability.rb', line 8

def initialize(user)
  @user = user

  can :access, :admin

  # Bypass all authorizations if disabled from configuration
  if Para::Acl.bypass_admin_authorization
    return can :manage, :all
  end

  process_authorizations
end

Instance Attribute Details

#userObject (readonly)

Returns the value of attribute user.



6
7
8
# File 'lib/para/acl/ability.rb', line 6

def user
  @user
end