Class: Itsf::Backend::DashboardPolicy
- Inherits:
-
Struct
- Object
- Struct
- Itsf::Backend::DashboardPolicy
- Defined in:
- app/policies/itsf/backend/dashboard_policy.rb
Instance Attribute Summary collapse
-
#dashboard ⇒ Object
Returns the value of attribute dashboard.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
Instance Attribute Details
#dashboard ⇒ Object
Returns the value of attribute dashboard
2 3 4 |
# File 'app/policies/itsf/backend/dashboard_policy.rb', line 2 def dashboard @dashboard end |
#user ⇒ Object
Returns the value of attribute user
2 3 4 |
# File 'app/policies/itsf/backend/dashboard_policy.rb', line 2 def user @user end |
Instance Method Details
#access? ⇒ Boolean
3 4 5 6 7 8 9 10 11 12 |
# File 'app/policies/itsf/backend/dashboard_policy.rb', line 3 def access? = self.class.name.gsub('Policy', '').underscore allowed = user.respond_to?(:allowed_to?) ? user.allowed_to?() : true if allowed Rails.logger.info "Allowed access to #{permission_identifier} for #{user}" else Rails.logger.info "Denied access to #{permission_identifier} for #{user}" end allowed end |