Add new permission contact_domain_view

This commit is contained in:
markjcrane
2021-06-30 13:01:33 -06:00
parent bfba65c494
commit 197948aa4a
2 changed files with 7 additions and 3 deletions

View File

@@ -52,6 +52,10 @@
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "contact_domain_view";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";
$y++;
$apps[$x]['permissions'][$y]['name'] = "contact_address_view";
$apps[$x]['permissions'][$y]['groups'][] = "superadmin";
$apps[$x]['permissions'][$y]['groups'][] = "admin";

View File

@@ -86,7 +86,7 @@
$sql .= "and contact_setting_name = 'array' ";
$sql .= "and contact_setting_value <> '' ";
$sql .= "and contact_setting_value is not null ";
if (!(if_group("superadmin") || if_group("admin"))) {
if (permission_exists('contact_domain_view') {
$sql .= "and ( "; //only contacts assigned to current user's group(s) and those not assigned to any group
$sql .= " contact_uuid in ( ";
$sql .= " select contact_uuid from v_contact_groups ";
@@ -187,7 +187,7 @@
$sql = "select count(*) ";
$sql .= "from v_contacts as c ";
$sql .= "where domain_uuid = :domain_uuid ";
if (!(if_group("superadmin") || if_group("admin"))) {
if (permission_exists('contact_domain_view') {
$sql .= "and ( "; //only contacts assigned to current user's group(s) and those not assigned to any group
$sql .= " contact_uuid in ( ";
$sql .= " select contact_uuid from v_contact_groups ";
@@ -395,4 +395,4 @@
//include the footer
require_once "resources/footer.php";
?>
?>