Module: Cassiopeia::ActionControllerClientMixin

Defined in:
lib/cassiopeia/action_controller_client_mixin.rb

Defined Under Namespace

Modules: ActionControllerMethods

Instance Method Summary collapse

Instance Method Details

#cas_require_roles(*roles) ⇒ Object



79
80
81
82
83
# File 'lib/cassiopeia/action_controller_client_mixin.rb', line 79

def cas_require_roles(*roles)
  @required_roles = [] unless defined? @required_roles
  @required_roles |= roles
  logger.debug "\nCAS add required role #{roles}, now roles_required: #{@required_roles}...\n" + "="*50
end

#cas_required_rolesObject



76
77
78
# File 'lib/cassiopeia/action_controller_client_mixin.rb', line 76

def cas_required_roles
  @required_roles
end

#use_cas_authorizationObject



84
85
86
87
88
# File 'lib/cassiopeia/action_controller_client_mixin.rb', line 84

def use_cas_authorization
  @current_user = nil
  before_filter :cas_require_user, :cas_check_required_roles
  include ActionControllerMethods
end