Class: CasUser
- Inherits:
-
Cms::TemporaryUser
- Object
- User
- Cms::TemporaryUser
- CasUser
- Defined in:
- app/models/cas_user.rb
Overview
This represents a user was authenticated using a CAS service. Their user data is not saved in the database (in the users table_, but is retrieved from an external service and stored purely as session data.
Constant Summary collapse
- GROUP_NAME =
"cas_group"
Instance Method Summary collapse
- #group ⇒ Object deprecated Deprecated.
-
#groups ⇒ Object
Using a single group for now.
-
#initialize(attributes = {}) ⇒ CasUser
constructor
A new instance of CasUser.
Methods inherited from Cms::TemporaryUser
#cms_access?, #save, #save!, #viewable_sections
Constructor Details
#initialize(attributes = {}) ⇒ CasUser
Returns a new instance of CasUser.
10 11 12 |
# File 'app/models/cas_user.rb', line 10 def initialize(attributes={}) super({ :first_name => "CAS", :last_name => "User"}.merge(attributes)) end |
Instance Method Details
#group ⇒ Object
Deprecated.
This exists only for backwards compatibility for when this used to inherit from GuestUser. It should be removed in 1.2.
21 22 23 |
# File 'app/models/cas_user.rb', line 21 def group Cms::Group.find_by_code(GROUP_NAME) end |
#groups ⇒ Object
Using a single group for now. (This will need to be mapped to more groups later).
15 16 17 |
# File 'app/models/cas_user.rb', line 15 def groups @groups ||= [group] end |