checking permissions in Preorder/Index
This commit is contained in:
@@ -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 )";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user