mirror of
https://github.com/Icinga/icingaweb2-module-businessprocess.git
synced 2026-01-05 13:19:35 -05:00
auth: Check the businessprocess/showall permission prior any restrictions
fixes #200
This commit is contained in:
parent
a1df0347f5
commit
56e37d2876
2 changed files with 9 additions and 4 deletions
|
|
@ -137,6 +137,10 @@ class Metadata
|
|||
}
|
||||
}
|
||||
|
||||
if ($auth->hasPermission('businessprocess/showall')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$prefixes = $auth->getRestrictions('businessprocess/prefix');
|
||||
if (! empty($prefixes)) {
|
||||
if (! $this->nameIsPrefixedWithOneOf($prefixes)) {
|
||||
|
|
@ -144,10 +148,6 @@ class Metadata
|
|||
}
|
||||
}
|
||||
|
||||
if ($auth->hasPermission('businessprocess/showall')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (! $this->hasRestrictions()) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,11 @@ abstract class BpConfigBaseForm extends QuickForm
|
|||
$meta = $config->getMetadata();
|
||||
$auth = Auth::getInstance();
|
||||
$meta->set('Owner', $auth->getUser()->getUsername());
|
||||
|
||||
if ($auth->hasPermission('businessprocess/showall')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$prefixes = $auth->getRestrictions('businessprocess/prefix');
|
||||
if (! empty($prefixes) && ! $meta->nameIsPrefixedWithOneOf($prefixes)) {
|
||||
if (count($prefixes) === 1) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue