Class: RouteAuthorizer::Permission
- Inherits:
-
Object
- Object
- RouteAuthorizer::Permission
- Includes:
- PermissionDSL
- Defined in:
- lib/route_authorizer/permission.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(role) ⇒ Permission
constructor
A new instance of Permission.
- #permit?(controller_path, action_name) ⇒ Boolean
Methods included from PermissionDSL
Constructor Details
#initialize(role) ⇒ Permission
Returns a new instance of Permission.
5 6 7 |
# File 'lib/route_authorizer/permission.rb', line 5 def initialize(role) @role = role.to_s end |
Instance Method Details
#permit?(controller_path, action_name) ⇒ Boolean
9 10 11 12 13 14 15 |
# File 'lib/route_authorizer/permission.rb', line 9 def permit?(controller_path, action_name) permit_action? [ [:all], [controller_path.to_sym, :all], [controller_path.to_sym, action_name.to_sym], ] end |