Class: EME::AdminUser::SessionInfo
- Inherits:
-
Object
- Object
- EME::AdminUser::SessionInfo
- Defined in:
- lib/eme/admin_user.rb
Constant Summary collapse
- BITS =
[]
Instance Attribute Summary collapse
-
#roles ⇒ Object
readonly
Returns the value of attribute roles.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #has_permission?(app, component, action) ⇒ Boolean
-
#initialize(data) ⇒ SessionInfo
constructor
A new instance of SessionInfo.
Constructor Details
#initialize(data) ⇒ SessionInfo
Returns a new instance of SessionInfo.
118 119 120 121 122 |
# File 'lib/eme/admin_user.rb', line 118 def initialize(data) @permissions = data["permissions"] @user = data["user"] @roles = data["roles"] end |
Instance Attribute Details
#roles ⇒ Object (readonly)
Returns the value of attribute roles.
115 116 117 |
# File 'lib/eme/admin_user.rb', line 115 def roles @roles end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
115 116 117 |
# File 'lib/eme/admin_user.rb', line 115 def user @user end |
Instance Method Details
#has_permission?(app, component, action) ⇒ Boolean
124 125 126 |
# File 'lib/eme/admin_user.rb', line 124 def (app, component, action) return @permissions[controller.to_s][action.to_s][method.to_s] if @permissions[controller.to_s] && @permissions[controller.to_s][action.to_s] end |