CRMTraits_Financial_FinancialACLTrait
Trait FinancialACLTrait
Trait for working with Financial ACLs in tests
Table of Contents
Methods
- addFinancialAclPermissions() : mixed
- Add a permission to the financial ACLs.
- addPermissions() : mixed
- Add a permission to the permissions array.
- createLoggedInUserWithFinancialACL() : int
- Create a logged in user limited by ACL permissions.
- disableFinancialACLs() : void
- Disable financial ACLs.
- enableFinancialACLs() : mixed
- Enable financial ACLs.
- setPermissions() : void
- Set ACL permissions, overwriting any existing ones.
Methods
addFinancialAclPermissions()
Add a permission to the financial ACLs.
protected
addFinancialAclPermissions(array<string|int, mixed> $aclPermissions) : mixed
Parameters
- $aclPermissions : array<string|int, mixed>
-
Array of ACL permissions in the format [[$action, $financialType], [$action, $financialType])
addPermissions()
Add a permission to the permissions array.
protected
addPermissions(array<string|int, mixed> $permissions) : mixed
Parameters
- $permissions : array<string|int, mixed>
-
Array of permissions to add - e.g. ['access CiviCRM','access CiviContribute'],
createLoggedInUserWithFinancialACL()
Create a logged in user limited by ACL permissions.
protected
createLoggedInUserWithFinancialACL([array<string|int, mixed> $aclPermissions = [['view', 'Donation']] ]) : int
Parameters
- $aclPermissions : array<string|int, mixed> = [['view', 'Donation']]
-
Array of ACL permissions in the format [[$action, $financialType], [$action, $financialType])
Return values
int —Contact ID
disableFinancialACLs()
Disable financial ACLs.
protected
disableFinancialACLs() : void
enableFinancialACLs()
Enable financial ACLs.
protected
enableFinancialACLs() : mixed
setPermissions()
Set ACL permissions, overwriting any existing ones.
protected
setPermissions(array<string|int, mixed> $permissions) : void
Parameters
- $permissions : array<string|int, mixed>
-
Array of permissions e.g ['access CiviCRM','access CiviContribute'],