Skip to content

Commit

Permalink
For #6518: restrict allowed apps when needed
Browse files Browse the repository at this point in the history
- implemented this by performing one search per app
  • Loading branch information
ebruchez committed Sep 30, 2024
1 parent 77ba592 commit 279e574
Showing 1 changed file with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,13 @@
<!-- Load form templates -->
<xf:send
if="$is-new-form"
submission="search-form-templates-submission"/>
submission="search-form-templates-submission">
<!-- Pass a string as we don't support sequences in tunnel parameters yet -->
<xf:property
name="remaining-app-names"
value="if ($app-chooser = 'select1') then string-join($allowed-apps-if-has-roles, ' ') else ()"
xxf:tunnel="true"/>
</xf:send>
<xf:setfocus
if="$is-new-form"
control="fb-templates-grid"/>
Expand Down Expand Up @@ -664,6 +670,14 @@

<!-- Set language upon submitting -->
<xf:action event="xforms-submit">
<xf:setvalue
ref="query[@name = 'application-name']"
value="
if (exists(event('remaining-app-names'))) then
xxf:split(event('remaining-app-names'))[1]
else
''"/>

<xf:setvalue ref="page-size" value="$page-size + 1"/>
<xf:setvalue ref="lang" value="'en'"/>
<!-- NOTE: xxf:lang() doesn't seem to work here -->
Expand Down Expand Up @@ -712,6 +726,22 @@
)
)"/>
<xf:setindex repeat="form-template-repeat" index="1"/>
<xf:var
name="remaining-app-names"
value="
if (exists(event('remaining-app-names'))) then
xxf:split(event('remaining-app-names'))[position() gt 1]
else
()"/>
<xf:send
if="exists($remaining-app-names)"
submission="search-form-templates-submission">
<!-- Pass a string as we don't support sequences in tunnel parameters yet -->
<xf:property
name="remaining-app-names"
value="string-join($remaining-app-names, ' ')"
xxf:tunnel="true"/>
</xf:send>
</xf:action>
</xf:submission>

Expand Down

0 comments on commit 279e574

Please sign in to comment.