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
21 class CRM_Core_Permission_UnitTests
extends CRM_Core_Permission_Base
{
24 * permission mapping to stub check() calls
27 public $permissions = NULL;
30 * Given a permission string, check for access requirements
33 * The permission to check.
37 * true if yes, else false
39 public function check($str, $userId = NULL) {
40 if ($str == CRM_Core_Permission
::ALWAYS_DENY_PERMISSION
) {
43 if ($str == CRM_Core_Permission
::ALWAYS_ALLOW_PERMISSION
) {
47 // return the stubbed permission (defaulting to true if the array is missing)
48 return is_array($this->permissions
) ?
in_array($str, $this->permissions
) : TRUE;
52 * Get the permissioned where clause for the user.
55 * The type of permission needed.
56 * @param array $tables
57 * (reference ) add the tables that are needed for the select clause.
58 * @param array $whereTables
59 * (reference ) add the tables that are needed for the where clause.
62 * the group where clause for this user
64 public function whereClause($type, &$tables, &$whereTables) {