Skip to content

SecurityService

Lightweight security checker mapping Action security methods to a decision enum.

Currently only supports isSecure + credentials check via context user.

class SecurityService

SourceExecution/SecurityService.php

public function __construct(Controller $controller): mixed

ParameterTypeDescription
$controllerController

Returns mixed

MethodDescription
decide(Action $action): SecurityDecisionDecides how the controller should proceed with a security-guarded action.

public function decide(Action $action): SecurityDecision

Decides how the controller should proceed with a security-guarded action.

An action that does not declare itself secure is allowed outright. Otherwise the user is resolved from the controller’s context container: anything that is not an ISecurityUser, or an ISecurityUser that is not authenticated, yields a login forward. An authenticated user that lacks the action’s declared credentials yields a secure forward; one that has them, or an action declaring no credentials, is allowed.

ParameterTypeDescription
$actionAction

Returns SecurityDecision