Class: Symphonia::User
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Symphonia::User
- Includes:
- ModelAttributes, UserManagement
- Defined in:
- app/models/symphonia/user.rb
Defined Under Namespace
Classes: Anonymous
Instance Attribute Summary collapse
-
#password_confirmation ⇒ Object
writeonly
Sets the attribute password_confirmation.
Instance Method Summary collapse
Methods inherited from ApplicationRecord
Instance Attribute Details
#password_confirmation=(value) ⇒ Object (writeonly)
Sets the attribute password_confirmation
33 34 35 |
# File 'app/models/symphonia/user.rb', line 33 def password_confirmation=(value) @password_confirmation = value end |
Instance Method Details
#allowed_to?(action) ⇒ Boolean
54 55 56 57 58 59 60 |
# File 'app/models/symphonia/user.rb', line 54 def allowed_to?(action) return true if admin? Rails.cache.fetch([:user_allowed_to, self, action]) do role_id && role.allowed_to?(action) end end |
#authorize?(controller, action) ⇒ Boolean
62 63 64 65 66 67 68 69 70 |
# File 'app/models/symphonia/user.rb', line 62 def (controller, action) return true if admin? if role_id role.(controller, action) else false end end |