Static Public Member Functions | |
static | canCurrentUserPerformAction ($actionType, $model) |
static | canUserPerformAction ($actionType, $model, $user) |
static | resolveLinkToModelForCurrentUser ($attributeString, $model, $moduleClassName, $linkRoute, $offset=null, $additionalParams=array()) |
static | resolveLinkToEditModelForCurrentUser ($attributeString, $model, $moduleClassName, $linkRoute, $redirectUrl=null) |
Helper class for working with action security classes
Definition at line 40 of file ActionSecurityUtil.php.
static canCurrentUserPerformAction | ( | $ | actionType, | |
$ | model | |||
) | [static] |
Definition at line 45 of file ActionSecurityUtil.php.
static canUserPerformAction | ( | $ | actionType, | |
$ | model, | |||
$ | user | |||
) | [static] |
Check if user can perform an action. Action type examples: Details, Edit, Delete. Action types are returned by actionElements via getActionType method. If the model is not a securable model then return true. If the model is a Permitable such as User this will return true. This does not necessarily mean the current user is allowed through the user interface to edit the $model (User). This must be controlled by controller rights filters.
$actionType | ||
$model | ||
$user |
Definition at line 63 of file ActionSecurityUtil.php.
static resolveLinkToModelForCurrentUser | ( | $ | attributeString, | |
$ | model, | |||
$ | moduleClassName, | |||
$ | linkRoute, | |||
$ | offset = null , |
|||
$ | additionalParams = array() | |||
) | [static] |
Resolve a link to a related model. Used by
$attributeString | ||
$model | ||
$moduleClassName | ||
$linkRoute | ||
null | $offset |
Definition at line 98 of file ActionSecurityUtil.php.
static resolveLinkToEditModelForCurrentUser | ( | $ | attributeString, | |
$ | model, | |||
$ | moduleClassName, | |||
$ | linkRoute, | |||
$ | redirectUrl = null | |||
) | [static] |
Resolve a link to a related model for editing. Used by some modal views for example. If the current user can Permission::WRITE the related model, then check if the current user has RIGHT_ACCESS_ to the model's related module. If current user has access then return link, otherwise return text. If current user cannot Permission::WRITE then return null.
$attributeString | ||
$model | ||
$moduleClassName | ||
$linkRoute | ||
null | $redirectUrl |
Definition at line 149 of file ActionSecurityUtil.php.