Methods summary
public
array
|
#
getGroupsForUser( string $userId )
Returns all groups of a user
Returns all groups of a user
Parameters
Returns
array List of group ids
Throws
|
public
integer
|
#
getIDForArea( string|integer $area )
Returns the id of an area. If passed area is numeric, it will returned
directly.
Returns the id of an area. If passed area is numeric, it will returned
directly.
Deprecated
[2015-05-21] This method is no longer supported (no replacement)
Parameters
- $area
string|integer $area
Returns
integer
Throws
|
public
integer
|
#
getIDForAction( string|integer $action )
Returns the id of an action. If passed action is numeric, it will returned
directly.
Returns the id of an action. If passed action is numeric, it will returned
directly.
Parameters
- $action
string|integer $action
Returns
integer
Throws
|
public
string
|
#
load_permissions( boolean $force = false )
Loads all permissions of groups where current logged in user is a member and
saves them in session.
Loads all permissions of groups where current logged in user is a member and
saves them in session.
Parameters
- $force
boolean $force [optional] Flag to force loading, event if they were cached before
Returns
string Returns diffrent values, depending on state: '1' (string) if permissions
couldn't loaded '3' (string) if permissions were loaded successfully
Throws
|
public
|
#
load_permissions_for_user( string $user )
Loads all permissions for a specific user or group. Stores area rights in
global variable $area_rights. Stores item rights in global variable
$item_rights.
Loads all permissions for a specific user or group. Stores area rights in
global variable $area_rights. Stores item rights in global variable
$item_rights.
Parameters
- $user
string $user User Id hash
Throws
|
public
boolean
|
#
have_perm_area_action_anyitem( string $area, integer $action = 0 )
Parameters
- $area
string $area
- $action
integer $action [optional]
Returns
boolean
Throws
|
public
boolean
|
#
have_perm_area_action_item( string $area, string $action, mixed $itemid )
Parameters
- $area
string $area
- $action
string $action
- $itemid
mixed $itemid
Returns
boolean
Throws
|
public
string|integer
|
#
getParentAreaId( integer|string $area )
Returns the parent id of passed area
Returns the parent id of passed area
Deprecated
[2015-05-21] This method is no longer supported (no replacement)
Parameters
- $area
integer|string $area Area id or name
Returns
string|integer name of parent area or passed area
Throws
|
public
boolean
|
#
have_perm_area_action( string $area, integer $action = 0 )
Parameters
- $area
string $area
- $action
integer $action [optional]
Returns
boolean
Throws
|
public
boolean
|
#
have_perm_client_lang( integer $client, integer $lang )
Parameters
- $client
integer $client
- $lang
integer $lang
Returns
boolean
|
public
boolean
|
#
hasClientPermission( boolean $iClient = false, object $oUser = false )
Checks if a user has access rights for a specific client.
Checks if a user has access rights for a specific client.
Parameters
- $iClient
boolean $iClient [optional] idclient to check, or false for the current client
- $oUser
object $oUser [optional] User object to check against, or false for the current user
Returns
boolean
Throws
|
public
boolean
|
#
isClientUser( integer $iClient, object $oUser )
Checks if the given user has access permission for a client
Checks if the given user has access permission for a client
Parameters
- $iClient
integer $iClient idclient to check
- $oUser
object $oUser User object to check against
Returns
boolean
Throws
|
public
boolean
|
#
isClientGroup( integer $iClient, object $oGroup )
Checks if the given group has access permission for a client
Checks if the given group has access permission for a client
Parameters
- $iClient
integer $iClient idclient to check
- $oGroup
object $oGroup Group object to check against
Returns
boolean
|
public
boolean
|
#
isClientAdmin( integer $iClient, object $oUser )
Checks if the given user has an admin permission
Checks if the given user has an admin permission
Parameters
- $iClient
integer $iClient idclient to check
- $oUser
object $oUser User object to check against
Returns
boolean
Throws
|
public
boolean
|
#
isSysadmin( object $oUser )
Checks if the given user has sysadmin permission
Checks if the given user has sysadmin permission
Parameters
- $oUser
object $oUser User object to check against
Returns
boolean
Throws
|
private
object
|
#
_checkUserObject( object $oUser )
Checks if the given object is a user object.
Checks if the given object is a user object.
If oUser is false, initialize the object from the currently logged in user.
If oUser is not an object of the class cApiUser, throw an exception.
Parameters
- $oUser
object $oUser User object
Returns
object
Throws
|
public
boolean
|
#
have_perm_client( string $perm = 'x' )
Parameters
- $perm
string $perm [optional]
Returns
boolean
|
public
boolean
|
#
have_perm( string $perm = 'x' )
Checks if user has permissions to passed perm.
- Sysadmin has allways permission
- Client admin has allways permission
Checks if user has permissions to passed perm.
- Sysadmin has allways permission
- Client admin has allways permission
Parameters
- $perm
string $perm [optional] Permissions (comma separated list of perms) to check
Returns
boolean
|
public
boolean
|
#
have_perm_item( string|integer $mainarea, integer $itemid )
Checks if an item have any perms
Checks if an item have any perms
Parameters
- $mainarea
string|integer $mainarea
- $itemid
integer $itemid
Returns
boolean
Throws
|
public
integer
|
#
showareas( string|integer $mainarea )
Parameters
- $mainarea
string|integer $mainarea
Returns
integer
Throws
|