Module: ActingFor
- Defined in:
- lib/acting_for.rb,
lib/acting_for/engine.rb,
lib/acting_for/errors.rb,
lib/acting_for/version.rb,
lib/acting_for/decision.rb,
app/models/acting_for/agent.rb,
app/models/acting_for/delegation.rb,
app/models/acting_for/audit_event.rb,
app/models/acting_for/application_record.rb,
app/services/acting_for/internal/authorization.rb,
app/services/acting_for/internal/delegation_creator.rb,
app/services/acting_for/internal/constraint_evaluator.rb
Defined Under Namespace
Modules: Internal
Classes: Agent, ApplicationRecord, AuditEvent, AuditPersistenceError, Decision, Delegation, Engine, Error, InternalError, InvalidRequestError
Constant Summary
collapse
- VERSION =
"0.1.1"
Class Method Summary
collapse
-
.authorize(agent:, principal:, action:, resource: nil, context: {}, audit_context_keys: []) ⇒ Object
-
.current_time ⇒ Object
-
.delegate(agent:, principal:, action:, resource: nil, constraints: [], effect:, expires_at: nil) ⇒ Object
Class Method Details
.authorize(agent:, principal:, action:, resource: nil, context: {}, audit_context_keys: []) ⇒ Object
7
8
9
10
11
12
|
# File 'lib/acting_for.rb', line 7
def self.authorize(agent:, principal:, action:, resource: nil, context: {}, audit_context_keys: [])
Internal::Authorization.call(
agent: agent, principal: principal, action: action, resource: resource, context: context,
audit_context_keys: audit_context_keys
)
end
|
.current_time ⇒ Object
21
22
23
|
# File 'lib/acting_for.rb', line 21
def self.current_time
Time.current
end
|
.delegate(agent:, principal:, action:, resource: nil, constraints: [], effect:, expires_at: nil) ⇒ Object
14
15
16
17
18
19
|
# File 'lib/acting_for.rb', line 14
def self.delegate(agent:, principal:, action:, resource: nil, constraints: [], effect:, expires_at: nil)
Internal::DelegationCreator.call(
agent: agent, principal: principal, action: action, resource: resource,
constraints: constraints, effect: effect, expires_at: expires_at
)
end
|