class CRM_Contact_BAO_Contact_Permission

Properties

static bool $useTempTable

Methods

static 
setUseTemporaryTable(bool $useTemporaryTable = TRUE)

Set whether to use a temporary table or not when building ACL Cache

static bool
getUseTemporaryTable()

Get variable for determining if we should use Temporary Table or not

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 ACLed 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, int $type)

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 44
static setUseTemporaryTable(bool $useTemporaryTable = TRUE)

Set whether to use a temporary table or not when building ACL Cache

Parameters

bool $useTemporaryTable

at line 52
static bool getUseTemporaryTable()

Get variable for determining if we should use Temporary Table or not

Return Value

bool

at line 73
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 159
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 218
static cache(int $userID, int|string $type = CRM_Core_Permission::VIEW, bool $force = FALSE)

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

Parameters

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

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

Parameters

string $contactAlias

Return Value

array

at line 369
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 391
static array relationshipList(array $contact_ids, int $type)

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
int $type access type CRM_Core_Permission::VIEW or CRM_Core_Permission::EDIT

Return Value

array List of contact IDs that the user has permissions for

at line 489
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 525
static initChecksumAuthSrc(bool $checkSumValidationResult = FALSE, null $form = NULL)

Parameters

bool $checkSumValidationResult
null $form

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

Parameters

int $contactID
CRM_Core_Form $form
bool $redirect

Return Value

bool