Skip to content

Commit

Permalink
PrivilegeAudit: Expand defined privileges when exporting to PDF
Browse files Browse the repository at this point in the history
refs #4862

(cherry picked from commit 314545f)
  • Loading branch information
nilmerg committed Nov 4, 2022
1 parent 5eaecbb commit 7d79a49
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions library/Icinga/Web/View/PrivilegeAudit.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ protected function auditPermission($permission)
empty($refusedBy) ? (empty($grantedBy) ? null : true) : false,
HtmlElement::create('details', [
'class' => ['collapsible', 'inheritance-paths'],
'data-no-persistence' => true
'data-no-persistence' => true,
'open' => getenv('ICINGAWEB_EXPORT_FORMAT') === 'pdf'
], [
$header->addAttributes(['class' => 'collapsible-control']),
$rolePaths
Expand Down Expand Up @@ -303,7 +304,8 @@ protected function auditRestriction($restriction)
'details',
Attributes::create([
'class' => ['collapsible', 'restrictions'],
'data-no-persistence' => true
'data-no-persistence' => true,
'open' => getenv('ICINGAWEB_EXPORT_FORMAT') === 'pdf'
]),
$header->addAttributes(['class' => 'collapsible-control']),
new HtmlElement('ul', null, ...$roles)
Expand All @@ -323,7 +325,8 @@ protected function assemble()
new HtmlElement(
'details',
Attributes::create([
'class' => ['collapsible', 'privilege-section']
'class' => ['collapsible', 'privilege-section'],
'open' => ($wildcardState || $unrestrictedState) && getenv('ICINGAWEB_EXPORT_FORMAT') === 'pdf'
]),
new HtmlElement(
'summary',
Expand Down Expand Up @@ -448,7 +451,9 @@ protected function assemble()
'li',
null,
HtmlElement::create('details', [
'class' => ['collapsible', 'privilege-section']
'class' => ['collapsible', 'privilege-section'],
'open' => ($anythingGranted || $anythingRefused || $anythingRestricted)
&& getenv('ICINGAWEB_EXPORT_FORMAT') === 'pdf'
], [
new HtmlElement(
'summary',
Expand Down

0 comments on commit 7d79a49

Please sign in to comment.