ClientManagers extends ClientController
Client portal managers controller
Table of Contents
Methods
| accounts() | List accounts |
| add() | Invites a new manager |
| edit() | Edits a manager |
| give() | Give up access for a managed account |
| index() | List managers |
| invite() | Accept a management invitation |
| manage() | Switches session to a managed account |
| preAction() | Pre action |
| revoke() | Revoke a manager |
| switch() | Switches back the session to the manager account |
| authorized() | Verifies that the currently logged in user is authorized for the given Controller and Action (or current Controller/Action if none given). |
| hasPermission() | Verifies if the current user has permission to the given area |
| isStaffAsClient() | Checks whether the current user is a staff user and whether the user is currently logged into the client portal. |
| requireLogin() | {@inheritdoc} |
| requirePermission() | Verifies permissions for the given generic $area |
| setNav() | Sets the primary and secondary navigation links. Performs authorization checks on each navigational element. |
Methods
accounts()
List accounts
public
accounts() : mixed
add()
Invites a new manager
public
add() : mixed
edit()
Edits a manager
public
edit() : mixed
give()
Give up access for a managed account
public
give() : mixed
index()
List managers
public
index() : mixed
invite()
Accept a management invitation
public
invite() : mixed
manage()
Switches session to a managed account
public
manage() : mixed
preAction()
Pre action
public
preAction() : mixed
revoke()
Revoke a manager
public
revoke() : mixed
switch()
Switches back the session to the manager account
public
switch() : mixed
authorized()
Verifies that the currently logged in user is authorized for the given Controller and Action (or current Controller/Action if none given).
protected
authorized([string $controller = null ][, string $action = null ][, stdClass $group = null ]) : bool
Will first check whether the Controller and Action is a permission value, and if so, checks to ensure the staff or client group user is authorized to access that resource
Parameters
- $controller : string = null
-
The controller to check authorization on, null will default to the current controller
- $action : string = null
-
The action to check authorization on, null will default to the current action
- $group : stdClass = null
-
The staff or client group to check authorization on, null will fetch the group of the current user
Return values
bool —Returns true if the user is authorized for that resource, false otherwise
hasPermission()
Verifies if the current user has permission to the given area
protected
hasPermission(string $area) : bool
Parameters
- $area : string
-
The generic area
Return values
bool —True if user has permission, false otherwise
isStaffAsClient()
Checks whether the current user is a staff user and whether the user is currently logged into the client portal.
protected
isStaffAsClient() : bool
Return values
bool —True if the user is a staff user logged in as a client, false otherwise
requireLogin()
{@inheritdoc}
protected
requireLogin([mixed $redirect_to = null ]) : mixed
Parameters
- $redirect_to : mixed = null
requirePermission()
Verifies permissions for the given generic $area
protected
requirePermission(string $area) : mixed
Parameters
- $area : string
-
The generic area
setNav()
Sets the primary and secondary navigation links. Performs authorization checks on each navigational element.
protected
setNav() : mixed
May cache nav results if possible for better performance.