Module: Tasker::Authorization
- Defined in:
- lib/tasker/authorization.rb,
lib/tasker/authorization/errors.rb,
lib/tasker/authorization/base_coordinator.rb,
lib/tasker/authorization/resource_registry.rb,
lib/tasker/authorization/resource_constants.rb
Overview
Authorization module providing resource-based authorization for Tasker.
This module implements a flexible, configuration-driven authorization system that follows the same dependency injection pattern as the authentication system. It provides:
- Resource-based permissions using "resource:action" patterns
- Pluggable authorization coordinators for custom logic
- Automatic controller integration via concerns
- User model integration via the Authorizable concern
Defined Under Namespace
Modules: ResourceConstants Classes: AuthorizationError, BaseCoordinator, ConfigurationError, ResourceRegistry, UnauthorizedError
Class Method Summary collapse
-
.action_exists?(resource, action) ⇒ Boolean
Check if an action exists for a resource.
-
.all_permissions ⇒ Array<String>
Get all available permissions in "resource:action" format.
-
.resource_exists?(resource) ⇒ Boolean
Check if a resource exists.
-
.resources ⇒ Hash
Get all available resources and their actions.
Class Method Details
.action_exists?(resource, action) ⇒ Boolean
Check if an action exists for a resource
71 72 73 |
# File 'lib/tasker/authorization.rb', line 71 def self.action_exists?(resource, action) ResourceRegistry.action_exists?(resource, action) end |
.all_permissions ⇒ Array<String>
Get all available permissions in "resource:action" format
54 55 56 |
# File 'lib/tasker/authorization.rb', line 54 def self. ResourceRegistry. end |
.resource_exists?(resource) ⇒ Boolean
Check if a resource exists
62 63 64 |
# File 'lib/tasker/authorization.rb', line 62 def self.resource_exists?(resource) ResourceRegistry.resource_exists?(resource) end |
.resources ⇒ Hash
Get all available resources and their actions
47 48 49 |
# File 'lib/tasker/authorization.rb', line 47 def self.resources ResourceRegistry.resources end |