projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #17915 from demeritcowboy/useradd-messages
[civicrm-core.git]
/
CRM
/
Contact
/
BAO
/
Contact
/
Permission.php
diff --git
a/CRM/Contact/BAO/Contact/Permission.php
b/CRM/Contact/BAO/Contact/Permission.php
index 964fc47295c245859ff2242eeb7d324301ac8770..1aae3cea9a7d54ad6f626ebe88f3a5d375454ae4 100644
(file)
--- a/
CRM/Contact/BAO/Contact/Permission.php
+++ b/
CRM/Contact/BAO/Contact/Permission.php
@@
-307,17
+307,16
@@
AND $operationClause
if (CRM_Core_Permission::check('view all contacts') ||
CRM_Core_Permission::check('edit all contacts')
) {
if (CRM_Core_Permission::check('view all contacts') ||
CRM_Core_Permission::check('edit all contacts')
) {
- if (
is_array($contactAlias
)) {
+ if (
!CRM_Core_Permission::check('access deleted contacts'
)) {
$wheres = [];
$wheres = [];
- foreach ($contactAlias as $alias) {
+ foreach (
(array)
$contactAlias as $alias) {
// CRM-6181
$wheres[] = "$alias.is_deleted = 0";
}
return [NULL, '(' . implode(' AND ', $wheres) . ')'];
}
else {
// CRM-6181
$wheres[] = "$alias.is_deleted = 0";
}
return [NULL, '(' . implode(' AND ', $wheres) . ')'];
}
else {
- // CRM-6181
- return [NULL, "$contactAlias.is_deleted = 0"];
+ return [NULL, '( 1 )'];
}
}
}
}
@@
-332,14
+331,17
@@
AND $operationClause
}
$fromClause = implode(" ", $clauses);
}
$fromClause = implode(" ", $clauses);
- $whereClase = NULL;
+ $whereCla
u
se = NULL;
}
else {
$fromClause = " INNER JOIN civicrm_acl_contact_cache aclContactCache ON {$contactAlias}.id = aclContactCache.contact_id ";
}
else {
$fromClause = " INNER JOIN civicrm_acl_contact_cache aclContactCache ON {$contactAlias}.id = aclContactCache.contact_id ";
- $whereClase = " aclContactCache.user_id = $contactID AND $contactAlias.is_deleted = 0";
+ $whereClause = " aclContactCache.user_id = $contactID";
+ if (!CRM_Core_Permission::check('access deleted contacts')) {
+ $whereClause .= " AND $contactAlias.is_deleted = 0";
+ }
}
}
- return [$fromClause, $whereClase];
+ return [$fromClause, $whereCla
u
se];
}
/**
}
/**