class CRM_Core_Permission_Temp

This supplements the permissions of the CMS system, allowing us to temporarily acknowledge permission grants for API keys.

In normal usage, the class isn't even instantiated - it's only used when processing certain API backends.

Properties

static $id

Methods

string|int
grant(string|array $perms)

Grant permissions temporarily.

revoke(string|int $id)

Revoke a previously granted permission.

bool
check(string $perm)

Determine if a permission has been granted.

array
index(array $grants)

Generate an optimized index of granted permissions.

Details

at line 67
string|int grant(string|array $perms)

Grant permissions temporarily.

Parameters

string|array $perms List of permissions to apply.

Return Value

string|int A handle for the grant. Useful for revoking later on.

at line 81
revoke(string|int $id)

Revoke a previously granted permission.

Parameters

string|int $id The handle previously returned by grant().

at line 93
bool check(string $perm)

Determine if a permission has been granted.

Parameters

string $perm The permission name (e.g. "view all contacts").

Return Value

bool

at line 105
protected array index(array $grants)

Generate an optimized index of granted permissions.

Parameters

array $grants Array(string $permName).

Return Value

array Array(string $permName => bool $granted).