Exponent v2.7.2

expPermissions
in package

This is the class expPermissions

Tags
subpackage

Subsystems

Table of Contents

check()  : bool
exdoc Looks to the permission data and checks to see if the current user has been granted the given permission(s) on the granted the given location.
checkGroup()  : bool
exdoc Checks to see if the given group has been given a specific permission on a location.
checkUser()  : bool
exdoc Checks to see if the given user has been given a specific permission.
grant()  : mixed
exdoc Grants the specified permission to the specified user, on the given location
grantGroup()  : mixed
exdoc Grants the specified permission to the specified user group, on the given location
load()  : mixed
exdoc Loads permission data from the database for the specified user.
revokeAll()  : mixed
exdoc Removes all permissions from a user, on a specific location.
revokeAllGroup()  : mixed
exdoc Removes all permissions from a group, on a specific location.
revokeComplete()  : bool
exdoc Removes all user and group permissions, on a specific location.
triggerRefresh()  : mixed
exdoc This call will force all active session to reload their permission data. This is useful if permissions are assigned or revoked, and is required to see these changes.

Methods

check()

exdoc Looks to the permission data and checks to see if the current user has been granted the given permission(s) on the granted the given location.

public static check(string|array<string|int, mixed> $permission, object $location) : bool

Returns true if the permission is granted, false if it is not.

Parameters
$permission : string|array<string|int, mixed>

The name of the permission to check

$location : object

The location to check on. This will be passed to getLocationHierarchy (defined by the module) for a full hierarchy of permissions.

Tags
node

Subsystems:expPermissions

Return values
bool

checkGroup()

exdoc Checks to see if the given group has been given a specific permission on a location.

public static checkGroup(mixed $group, string $permission, object $location[, bool $explicitOnly = false ]) : bool

Returns true if the permission is granted, false if it is not.

Parameters
$group : mixed
$permission : string

The name of the permission to check

$location : object

The location to check on.

$explicitOnly : bool = false
Tags
node

Subsystems:expPermissions

Return values
bool

checkUser()

exdoc Checks to see if the given user has been given a specific permission.

public static checkUser(mixed $user, string $permission, object $location[, bool $explicitOnly = false ]) : bool

Handles explicit checks (actually assigned to the user) implicit and inherited checks (assigned to a group the user belongs to). Returns true if the permission is granted, false if it is not.

Parameters
$user : mixed
$permission : string

The name of the permission to check

$location : object

The location to check on.

$explicitOnly : bool = false

Whether to check for explicit/implicit assignment or inherited.

Tags
node

Subsystems:expPermissions

Return values
bool

grant()

exdoc Grants the specified permission to the specified user, on the given location

public static grant(mixed $user, string $permission, object $location) : mixed
Parameters
$user : mixed
$permission : string

The name of the permission to grant

$location : object

The location to grant the permission on

Tags
node

Subsystems:expPermissions

Return values
mixed

grantGroup()

exdoc Grants the specified permission to the specified user group, on the given location

public static grantGroup(mixed $group, string $permission, object $location) : mixed
Parameters
$group : mixed
$permission : string

The name of the permission to grant

$location : object

The location to grant the permission on

Tags
node

Subsystems:expPermissions

Return values
mixed

load()

exdoc Loads permission data from the database for the specified user.

public static load(mixed $user) : mixed
Parameters
$user : mixed
Tags
node

Subsystems:expPermissions

Return values
mixed

revokeAll()

exdoc Removes all permissions from a user, on a specific location.

public static revokeAll(mixed $user, object $location) : mixed
Parameters
$user : mixed
$location : object

The location to remove all permission on

Tags
node

Subsystems:expPermissions

Return values
mixed

revokeAllGroup()

exdoc Removes all permissions from a group, on a specific location.

public static revokeAllGroup(mixed $group, object $location) : mixed
Parameters
$group : mixed
$location : object

The location to remove all permission on

Tags
node

Subsystems:expPermissions

Return values
mixed

revokeComplete()

exdoc Removes all user and group permissions, on a specific location.

public static revokeComplete(object $location) : bool
Parameters
$location : object
Tags
node

Subsystems:expPermissions

Return values
bool

triggerRefresh()

exdoc This call will force all active session to reload their permission data. This is useful if permissions are assigned or revoked, and is required to see these changes.

public static triggerRefresh() : mixed
Tags
node

Subsystems:expPermissions

deprecated
2.3.3

moved into expSession

Return values
mixed

Search results