Class X2AuthManager
RBAC auth manager for X2Engine
-
CComponent
-
CApplicationComponent
implements
IApplicationComponent
-
CAuthManager
implements
IAuthManager
-
CDbAuthManager
-
X2AuthManager
Methods summary
public
boolean
|
#
checkAccess( string $itemName, integer $userId, array $params = array() )
Access check function.
Checks access and attempts to speed up all future access checks using caching
and storage of the variable within _access.
Note, only if parameters are empty will permissions caching or storage in
_access be effective, because parameters (i.e. the assignment of a
record based on the value of its assignedTo field) are expected to vary. For
example, in record-specific permission items checked for multiple records. That
is why $params be empty for any shortcuts to be taken.
Parameters
- $itemName
string $itemName Name of the auth item for which access is being checked
- $userId
integer $userId ID of the user for which to check access
- $params
array $params Parameters to pass to business rules
Returns
boolean
Overrides
CDbAuthManager::checkAccess()
|
protected
|
|
public
|
#
checkAdminOn( array $params )
Checks for admin access on a specific named module.
Checks for admin access on a specific named module.
Originally written as a kludge to bypass checking for overall admin access
when performing a generic admin action that is specific to a module.
Specifically, it was written for exporting models as a fix for 4.1.6, wherein
otherwise a user would need full admin rights and not just contact module admin
rights to export contacts.
Note, since this starts its own chain of recursive access checking, extreme
caution should be used when using this method inside of a business rule, because
infinite loops could potentially occur.
Parameters
- $params
array $params An associative array that is presumed to contain a "userId" element that
refers to the user ID (as if $params is as within a business rule), and also
expects a model (or module) parameter.
|
public
boolean
|
#
checkAssignment( array $params )
Assignment check function for business rules. Note that this method does not
check for assignment to "Anyone". At the time of this writing, checkAssignment
is used exclusively for checking permissions related to private access.
Assignment check function for business rules. Note that this method does not
check for assignment to "Anyone". At the time of this writing, checkAssignment
is used exclusively for checking permissions related to private access.
Parameters
Returns
boolean
|
public
boolean
|
#
checkVisibility( array $params )
Visibility check function for business rules
Visibility check function for business rules
Parameters
Returns
boolean
|
Methods inherited from CDbAuthManager
addItemChild(),
assign(),
checkAccessRecursive(),
clearAll(),
clearAuthAssignments(),
createAuthItem(),
detectLoop(),
getAuthAssignment(),
getAuthAssignments(),
getAuthItem(),
getAuthItems(),
getDbConnection(),
getItemChildren(),
hasItemChild(),
init(),
isAssigned(),
removeAuthItem(),
removeItemChild(),
revoke(),
save(),
saveAuthAssignment(),
saveAuthItem(),
usingSqlite()
|
Methods inherited from CAuthManager
checkItemChildType(),
createOperation(),
createRole(),
createTask(),
executeBizRule(),
getOperations(),
getRoles(),
getTasks()
|
Methods inherited from CApplicationComponent
getIsInitialized()
|
Methods inherited from CComponent
__call(),
__get(),
__isset(),
__set(),
__unset(),
asa(),
attachBehavior(),
attachBehaviors(),
attachEventHandler(),
canGetProperty(),
canSetProperty(),
detachBehavior(),
detachBehaviors(),
detachEventHandler(),
disableBehavior(),
disableBehaviors(),
enableBehavior(),
enableBehaviors(),
evaluateExpression(),
getEventHandlers(),
hasEvent(),
hasEventHandler(),
hasProperty(),
raiseEvent()
|
Properties inherited from CDbAuthManager
$assignmentTable,
$connectionID,
$db,
$itemChildTable,
$itemTable
|
Properties inherited from CAuthManager
$defaultRoles,
$showErrors
|
Properties inherited from CApplicationComponent
$behaviors
|
Magic properties inherited from CDbAuthManager
$authItems
|
Magic properties inherited from CAuthManager
$operations,
$roles,
$tasks
|
Magic properties inherited from CApplicationComponent
$isInitialized
|