Class: CanTango::Model::Scope::AllowedActions

Inherits:
Object
  • Object
show all
Includes:
Api::User::Ability
Defined in:
lib/cantango/model/scope.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Api::User::Ability

#current_user_ability, #user_ability

Methods included from Api::Options

#ability_options, options_list, #options_list

Methods included from Api::Common

#category, #create_ability

Constructor Details

#initialize(clazz, mode, *actions) ⇒ AllowedActions

Returns a new instance of AllowedActions.



19
20
21
22
23
# File 'lib/cantango/model/scope.rb', line 19

def initialize clazz, mode, *actions
  @clazz = clazz
  @mode = mode
  @actions = actions.flatten
end

Instance Attribute Details

#actionsObject (readonly)

Returns the value of attribute actions.



17
18
19
# File 'lib/cantango/model/scope.rb', line 17

def actions
  @actions
end

#clazzObject (readonly)

Returns the value of attribute clazz.



17
18
19
# File 'lib/cantango/model/scope.rb', line 17

def clazz
  @clazz
end

#modeObject (readonly)

Returns the value of attribute mode.



17
18
19
# File 'lib/cantango/model/scope.rb', line 17

def mode
  @mode
end

Instance Method Details

#by_account(account) ⇒ Object



30
31
32
# File 'lib/cantango/model/scope.rb', line 30

def  
  check ()
end

#by_user(user) ⇒ Object Also known as: by



25
26
27
# File 'lib/cantango/model/scope.rb', line 25

def by_user user
  check user_ability(user)
end