Class: RoleDecorator
- Inherits:
-
ApplicationDecorator
- Object
- Draper::Decorator
- ApplicationDecorator
- RoleDecorator
- Defined in:
- lib/aptible/rails/decorators/role_decorator.rb
Instance Method Summary collapse
Methods inherited from ApplicationDecorator
Instance Method Details
#cached_permissions ⇒ Object
11 12 13 14 15 |
# File 'lib/aptible/rails/decorators/role_decorator.rb', line 11 def garner.bind(h.controller.session_token) do object. end end |
#can?(scope, account) ⇒ Boolean
2 3 4 5 |
# File 'lib/aptible/rails/decorators/role_decorator.rb', line 2 def can?(scope, account) role_scopes = (account).map(&:scope) role_scopes.include?('manage') || role_scopes.include?(scope) end |
#has?(scope, account) ⇒ Boolean
7 8 9 |
# File 'lib/aptible/rails/decorators/role_decorator.rb', line 7 def has?(scope, account) (account).map(&:scope).include?(scope) end |