PrivilegeAudit: Show missing initiators in inheritance paths

This commit is contained in:
Johannes Meyer 2021-04-06 16:10:21 +02:00
parent b5334a063e
commit 314ec5256c
1 changed files with 2 additions and 7 deletions

View File

@ -112,7 +112,6 @@ class PrivilegeAudit extends BaseHtmlElement
$path = new HtmlElement('ol'); $path = new HtmlElement('ol');
$class = null; $class = null;
$initiator = null;
$setInitiator = false; $setInitiator = false;
foreach ($rolesReversed as $role) { foreach ($rolesReversed as $role) {
$granted = false; $granted = false;
@ -136,7 +135,7 @@ class PrivilegeAudit extends BaseHtmlElement
$connector = new HtmlElement('li', ['class' => ['connector', $class]]); $connector = new HtmlElement('li', ['class' => ['connector', $class]]);
if ($setInitiator) { if ($setInitiator) {
$setInitiator = false; $setInitiator = false;
$initiator = $connector; $connector->getAttributes()->add('class', 'initiator');
} }
$path->prepend($connector); $path->prepend($connector);
@ -156,10 +155,6 @@ class PrivilegeAudit extends BaseHtmlElement
} }
} }
if ($initiator !== null) {
$initiator->getAttributes()->add('class', 'initiator');
}
if ($vClass === null || $vClass === 'granted') { if ($vClass === null || $vClass === 'granted') {
$vClass = $class; $vClass = $class;
} }
@ -169,7 +164,7 @@ class PrivilegeAudit extends BaseHtmlElement
new HtmlElement('li', ['class' => [ new HtmlElement('li', ['class' => [
'connector', 'connector',
$class, $class,
$initiator === null ? 'initiator' : null $setInitiator ? 'initiator' : null
]]) ]])
])); ]));
} }