checking permissions in Preorder/Index

This commit is contained in:
Frank Schubert
2022-11-22 17:06:48 +01:00
parent 5531b69f65
commit 520e68b44b
8 changed files with 54 additions and 53 deletions

View File

@@ -114,19 +114,21 @@ class AddresstypeModel {
/*
* Address Type
*/
if(is_array($filter['addresstype']) && count($filter['addresstype'])) {
$at = $filter['addresstype'];
$in = [];
foreach(TT_ROLES as $role) {
if(in_array($role, $at)) {
$in[] = "Addresstype.type = '$role'";
if(array_key_exists('addresstype', $filter)) {
if(is_array($filter['addresstype']) && count($filter['addresstype'])) {
$at = $filter['addresstype'];
$in = [];
foreach(TT_ROLES as $role) {
if(in_array($role, $at)) {
$in[] = "Addresstype.type = '$role'";
}
}
$or = "";
if(count($in)) {
$or = implode(" OR ", $in);
$where .= " AND ( $or )";
}
}
$or = "";
if(count($in)) {
$or = implode(" OR ", $in);
$where .= " AND ( $or )";
}
}