Skip to content

AclInterface

Contract for ACL builders backed by PhalconKit permission arrays.

Implementations compile framework/application permission config into a native Phalcon ACL object. The interface extends OptionsInterface so services can be configured with a default permission tree and reused by controllers, identity services, or tests.


Methods

get

Build an in-memory ACL from one or more permission component sections.

public get(array<int,string> $componentsName = ['components'], array<string,mixed>|null $permissions = null, string $inherit = 'inherit'): \Phalcon\Acl\Adapter\Memory

Parameters:

Parameter Type Description
$componentsName array Permission sections to include.
$permissions array|null Permission tree to compile,
or null to use the service options.
$inherit string Role-inheritance key.

Inherited methods

__construct

Initialize the object with an optional default option set.

public __construct(array<string,mixed>|null $options = null): mixed

Parameters:

Parameter Type Description
$options array|null Defaults to capture and apply.

initializeOptions

Capture defaults, apply current options, and run object initialization.

public initializeOptions(array<string,mixed>|null $options = null): void

Parameters:

Parameter Type Description
$options array|null Defaults to capture and apply.

initialize

Optional hook called after options are initialized.

public initialize(): void

setOptions

Replace the current option set.

public setOptions(array<string,mixed> $options): void

Null-valued entries remain present in the raw option array but are read as missing by

  • See: \PhalconKit\Support\Options\getOption().

Parameters:

Parameter Type Description
$options array Options to apply.

getOptions

Return the current option set.

public getOptions(): array<string,mixed>

setOption

Store or replace one option value.

public setOption(string $key, mixed $value = null): void

Passing null stores the key in the raw option array, but public lookups treat that key as missing.

Parameters:

Parameter Type Description
$key string
$value mixed

getOption

Return one option value or a default when it is missing or null.

public getOption(string $key, mixed $default = null): mixed

Parameters:

Parameter Type Description
$key string
$default mixed

removeOption

Remove one option key when it exists in the raw option array.

public removeOption(string $key): void

Parameters:

Parameter Type Description
$key string

resetOptions

Restore current options to the initialized defaults.

public resetOptions(): void

clearOptions

Remove all current option values.

public clearOptions(): void