3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
23 class CRM_Core_Permission_UnitTests
extends CRM_Core_Permission_Base
{
26 * permission mapping to stub check() calls
29 public $permissions = NULL;
32 * Given a permission string, check for access requirements
35 * The permission to check.
39 * true if yes, else false
41 public function check($str, $userId = NULL) {
42 if ($str == CRM_Core_Permission
::ALWAYS_DENY_PERMISSION
) {
45 if ($str == CRM_Core_Permission
::ALWAYS_ALLOW_PERMISSION
) {
49 // return the stubbed permission (defaulting to true if the array is missing)
50 return is_array($this->permissions
) ?
in_array($str, $this->permissions
) : TRUE;
54 * Get the permissioned where clause for the user.
57 * The type of permission needed.
58 * @param array $tables
59 * (reference ) add the tables that are needed for the select clause.
60 * @param array $whereTables
61 * (reference ) add the tables that are needed for the where clause.
64 * the group where clause for this user
66 public function whereClause($type, &$tables, &$whereTables) {