class CRM_Contact_BAO_Contact_Permission

Methods

static array
allowList(array $contact_ids, int $type = CRM_Core_Permission::VIEW)

Check which of the given contact IDs the logged in user has permissions for the operation type according to: - general permissions (e.g. 'edit all contacts') - deletion status (unless you have 'access deleted contacts') - ACL - permissions inherited through relationships (also second degree if enabled)

static bool
allow(int $id, int|string $type = CRM_Core_Permission::VIEW)

Check if the logged in user has permissions for the operation type.

static 
cache(int $userID, int|string $type = CRM_Core_Permission::VIEW, bool $force = FALSE)

Fill the acl contact cache for this contact id if empty.

static array
cacheClause(string $contactAlias = 'contact_a')

No description

static string|null
cacheSubquery()

Generate acl subquery that can be placed in the WHERE clause of a query or the ON clause of a JOIN.

static array
relationshipList(array $contact_ids)

Filter a list of contact_ids by the ones that the currently active user as a permissioned relationship with

static bool
validateOnlyChecksum(int $contactID, CRM_Core_Form $form, bool $redirect = TRUE)

No description

static 
initChecksumAuthSrc(bool $checkSumValidationResult = FALSE, null $form = NULL)

No description

static bool
validateChecksumContact(int $contactID, CRM_Core_Form $form, bool $redirect = TRUE)

No description

Details

at line 52
static array allowList(array $contact_ids, int $type = CRM_Core_Permission::VIEW)

Check which of the given contact IDs the logged in user has permissions for the operation type according to: - general permissions (e.g. 'edit all contacts') - deletion status (unless you have 'access deleted contacts') - ACL - permissions inherited through relationships (also second degree if enabled)

Parameters

array $contact_ids Contact IDs.
int $type the type of operation (view|edit)

Return Value

array list of contact IDs the logged in user has the given permission for

See also

CRM_Contact_BAO_Contact_Permission::allow

at line 138
static bool allow(int $id, int|string $type = CRM_Core_Permission::VIEW)

Check if the logged in user has permissions for the operation type.

Parameters

int $id Contact id.
int|string $type the type of operation (view|edit)

Return Value

bool true if the user has permission, false otherwise

at line 197
static cache(int $userID, int|string $type = CRM_Core_Permission::VIEW, bool $force = FALSE)

Fill the acl contact cache for this contact id if empty.

Parameters

int $userID
int|string $type the type of operation (view|edit)
bool $force Should we force a recompute.

at line 268
static array cacheClause(string $contactAlias = 'contact_a')

Parameters

string $contactAlias

Return Value

array

at line 314
static string|null cacheSubquery()

Generate acl subquery that can be placed in the WHERE clause of a query or the ON clause of a JOIN.

This is specifically for VIEW operations.

Return Value

string|null

at line 333
static array relationshipList(array $contact_ids)

Filter a list of contact_ids by the ones that the currently active user as a permissioned relationship with

Parameters

array $contact_ids List of contact IDs to be filtered

Return Value

array List of contact IDs that the user has permissions for

at line 424
static bool validateOnlyChecksum(int $contactID, CRM_Core_Form $form, bool $redirect = TRUE)

Parameters

int $contactID
CRM_Core_Form $form
bool $redirect

Return Value

bool

at line 460
static initChecksumAuthSrc(bool $checkSumValidationResult = FALSE, null $form = NULL)

Parameters

bool $checkSumValidationResult
null $form

at line 480
static bool validateChecksumContact(int $contactID, CRM_Core_Form $form, bool $redirect = TRUE)

Parameters

int $contactID
CRM_Core_Form $form
bool $redirect

Return Value

bool