mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
Prepared auth filters. Auth part still missing
This commit is contained in:
parent
ecaa12b0f4
commit
0ffef655df
@ -89,6 +89,16 @@ class AbstractView extends AbstractQuery
|
|||||||
*/
|
*/
|
||||||
protected $sortDefaults = array();
|
protected $sortDefaults = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Filters that will be enforced (e.g. AND for SQL), will be used for auth
|
||||||
|
* restrictions
|
||||||
|
*
|
||||||
|
* TODO: rename to enforcedFilters?
|
||||||
|
*
|
||||||
|
* @var Array
|
||||||
|
*/
|
||||||
|
protected $forcedFilters = array();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether this view provides a specific column name
|
* Whether this view provides a specific column name
|
||||||
*
|
*
|
||||||
@ -184,7 +194,8 @@ class AbstractView extends AbstractQuery
|
|||||||
|
|
||||||
// TODO: applyAuthFilters(Auth $auth = null)
|
// TODO: applyAuthFilters(Auth $auth = null)
|
||||||
// AbstractView will enforce restrictions as provided by the Auth
|
// AbstractView will enforce restrictions as provided by the Auth
|
||||||
// backend
|
// backend. Those filters work like normal ones and have to be stored
|
||||||
|
// by applyAuthFilters to $this->forcedFilters
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Apply an array of filters. This might become obsolete or even improved
|
* Apply an array of filters. This might become obsolete or even improved
|
||||||
@ -269,6 +280,9 @@ class AbstractView extends AbstractQuery
|
|||||||
foreach ($this->filters as $f) {
|
foreach ($this->filters as $f) {
|
||||||
$query->where($f[0], $f[1]);
|
$query->where($f[0], $f[1]);
|
||||||
}
|
}
|
||||||
|
foreach ($this->forcedFilters as $col => $filter) {
|
||||||
|
$query->where($col, $filter);
|
||||||
|
}
|
||||||
foreach ($this->order_columns as $col) {
|
foreach ($this->order_columns as $col) {
|
||||||
|
|
||||||
if (isset($this->sortDefaults[$col[0]]['columns'])) {
|
if (isset($this->sortDefaults[$col[0]]['columns'])) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user