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
57 58 59 60 61 62 63 |
# File 'app/models/symphonia/user.rb', line 57 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
65 66 67 68 69 70 71 72 73 |
# File 'app/models/symphonia/user.rb', line 65 def (controller, action) return true if admin? if role_id role.(controller, action) else false end end |