Module: Rolypoly::ControllerRoleDSL::ClassMethods

Defined in:
lib/rolypoly/controller_role_dsl.rb

Instance Method Summary collapse

Instance Method Details

#all_publicObject



50
51
52
# File 'lib/rolypoly/controller_role_dsl.rb', line 50

def all_public
  build_gatekeeper(nil, nil).all_public
end

#allow(*roles) ⇒ Object



58
59
60
# File 'lib/rolypoly/controller_role_dsl.rb', line 58

def allow(*roles)
  build_gatekeeper roles, nil
end

#publicize(*actions) ⇒ Object



62
63
64
# File 'lib/rolypoly/controller_role_dsl.rb', line 62

def publicize(*actions)
  restrict(*actions).to_none
end

#restrict(*actions) ⇒ Object



54
55
56
# File 'lib/rolypoly/controller_role_dsl.rb', line 54

def restrict(*actions)
  build_gatekeeper nil, actions
end

#rolypoly_gatekeepersObject



66
67
68
# File 'lib/rolypoly/controller_role_dsl.rb', line 66

def rolypoly_gatekeepers
  @rolypoly_gatekeepers ||= []
end