IPrincipal

Principal classes must implement this interface. Artaengine uses principal classes to validate user access permissions for URLs, factories and classes. Custom principal classes can be created and used they must implement this interface. A custom principal class can be set in the app configs. This principal validates the required permissions which are defined in the app URL/Factory mapping setting file against the user's permissions which may exists in the session. SESSION[user_data] = {group: {name: user-group-name}, permissions: {permission-key1:, permission-key2:,}}
Source
IPrincipal.php
Implementations
Skinner

Constants

ILLEGAL = 3

Permissions are invalid or not sufficient.

OK = 1

Permissions granted.

UNAUTHORIZED = 2

User is not authorized (signed in).

Static Methods

cls

const IPrincipal::cls(string class)

Checks permissions required for a PHP class to be used (if any) against user permissions. Class required permissions are inside "Arta::$permissionsClass".

Arguments

    class (string)
    PHP class name

Returns

const
IPrincipal::OK or IPrincipal::ILLEGAL or IPrincipal::UNAUTHORIZED

factory

const IPrincipal::factory(string class, string method=null)

Checks permissions required for a factory before calling it (if any) against the user permissions. Factory required permissions can be found inside "Arta::$permissionsFactory".

Arguments

    class (string)
    Factory class name
    method=null (string)
    Factory method name

Returns

const
IPrincipal::OK or IPrincipal::ILLEGAL or IPrincipal::UNAUTHORIZED

url

const IPrincipal::url(array permissions)

Checks permissions required for a URL to be handled (if any) against the user permissions.

Arguments

    permissions (array)
    Permissions required for the URL {permission: 1,}

Returns

const
IPrincipal::OK or IPrincipal::ILLEGAL or IPrincipal::UNAUTHORIZED