Skinner

Default principal class, Artaengine uses this class to validate user access permissions for URLs, factories and classes. Custom principal classes can be created and used they must implement the "IPrincipal" interface thought. 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
Skinner.php
Implements
IPrincipal
Depends on
Session , Arta

Static Methods

cls

const Skinner::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 Skinner::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 Skinner::url(array permissions)

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

Arguments

    permissions (array)
    List of permission tokens required for the URL [permissions]

Returns

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