Skip to content

Commit

Permalink
TASK: Render the action buttons only if the privileges are granted to…
Browse files Browse the repository at this point in the history
… the user

This avoids error-messages by users clicking on actions they have no access to.
  • Loading branch information
mficzel committed Apr 11, 2019
1 parent 5e396f8 commit a461f4e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Resources/Private/Partials/TaxonRecursive.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@
</td>
<td>
<div class="neos-pull-right">

<f:security.ifAccess privilegeTarget="Sitegeist.Taxonomy:Module.ManageTaxonomyActions">

<f:link.action action="newTaxonomy" arguments="{parent : taxon.node.contextPath}" title="{f:translate(id: 'module.taxonRecursive.addSubTaxon')}" class="neos-button neos-button-primary">
<i class="fas fa-plus"></i>
</f:link.action>
Expand Down Expand Up @@ -61,6 +64,8 @@

</f:if>

</f:security.ifAccess>

</div>
</td>
</tr>
Expand Down
9 changes: 9 additions & 0 deletions Resources/Private/Templates/Module/Index.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ <h3>

<div class="widget-footer">

<f:security.ifAccess privilegeTarget="Sitegeist.Taxonomy:Module.ManageVocabularyActions">

<f:link.action action="editVocabulary" class="neos-button" title="{f:translate(id: 'module.index.editVocabulary')}" arguments="{vocabulary: vocabulary.node.contextPath}" >
<i class="fas fa-pencil-alt"></i>
</f:link.action>
Expand Down Expand Up @@ -66,6 +68,9 @@ <h3>
<div class="neos-modal-backdrop neos-in"></div>
</div>
</f:if>

</f:security.ifAccess>

</div>
</div>
</div>
Expand All @@ -89,6 +94,7 @@ <h3>
</f:else>
</f:if>

<f:security.ifAccess privilegeTarget="Sitegeist.Taxonomy:Module.ManageVocabularyActions">

<div class="neos-row-fluid">

Expand All @@ -97,4 +103,7 @@ <h3>
</f:link.action>

</div>

</f:security.ifAccess>

</f:section>
4 changes: 4 additions & 0 deletions Resources/Private/Templates/Module/Vocabulary.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
</f:else>
</f:if>

<f:security.ifAccess privilegeTarget="Sitegeist.Taxonomy:Module.ManageTaxonomyActions">

<div class="neos-row-fluid">
<f:link.action action="index" class="neos-button" title="" arguments="{root: taxonomyRoot}" >
<i class="fas fa-backward icon-white"></i> {f:translate(id: 'module.vocabulary.backToIndex')}
Expand All @@ -53,4 +55,6 @@
</f:link.action>
</div>

</f:security.ifAccess>

</f:section>

0 comments on commit a461f4e

Please sign in to comment.