Source: ~/modules/backend/classes/AuthManager.php


Back-end authentication manager.

Public properties

There are no public properties in the class.

Show inherited public properties

Inherited public properties

Protected properties

protected static $instance

protected $sessionKey

Key to store the auth session data in

protected $userModel

User Model Class

protected $groupModel

User Group Model Class

protected $throttleModel

Throttle Model Class

protected $requireActivation

Flag to require users to be activated to login

protected static $permissionDefaults

protected array $callbacks

Cache of registration callbacks.

protected array $permissions

List of registered permissions.

protected array $permissionRoles

List of registered permission roles.

protected array $permissionCache

Cache of registered permissions.

Show inherited protected properties

Inherited protected properties

Public methods

public void hasPermissionsForRole($role)
  • $role

public array listPermissions()

Returns a list of the registered permissions items.

public array listPermissionsForRole(string $role, $includeOrphans=true)

Returns an array of registered permissions belonging to a given role code

  • string $role
  • $includeOrphans

public array listTabbedPermissions()

Returns an array of registered permissions, grouped by tabs.

public void registerCallback(callable $callback)

Registers a callback function that defines authentication permissions. The callback function should register permissions by calling the manager's registerPermissions() function. The manager instance is passed to the callback function as an argument. Usage:

  • callable $callback - A callable function.

public void registerPermissions(string $owner, array $definitions)

Registers the back-end permission items. The argument is an array of the permissions. The array keys represent the permission codes, specific for the plugin/module. Each element in the array should be an associative array with the following keys:

  • label - specifies the menu label localization string key, required.
  • order - a position of the item in the menu, optional.
  • comment - a brief comment that describes the permission, optional.
  • tab - assign this permission to a tabbed group, optional.
  • string $owner - Specifies the menu items owner plugin or module in the format Vendor/Module.
  • array $definitions - An array of the menu item definitions.

Show inherited public methods

Inherited public methods

Protected methods

Show inherited protected methods

Inherited protected methods