03-26-2021 04:01 PM
This is related to a question I posted a few weeks ago, https://answers.nuxeo.com/general/q/2b7e0103f3a84092af278beb46e2dbbf/Can-I-hide-Empty-Trash-from-som.... We wanted to hide the "Empty Trash" button from everyone that is not an admin. The solution was great until we realized that users with manage permission could still see the button. We changed our filter, we are currently trying this:
<nuxeo-slot-content name="hardDeleteSelectionAction" slot="TRASH_RESULTS_SELECTION_ACTIONS" order="20">
<template>
<nuxeo-filter document="[[document]]" permission="Everything" user="[[user]]">
<template>
<nuxeo-delete-documents-button documents="[[selectedItems]]" hard></nuxeo-delete-documents-button>
</template>
</nuxeo-filter>
</nuxeo-slot-content>
But we can't get our changes to reflect locally. We have tried to filter to users with ReadWrite as a test and it still didn't change, users with manage could still see the button and when we changed them to edit they couldn't see the button. We tried removing the code entirely and we had the same results. We figure something is cached or somehow stuck but we don't know what to do to get our changes to reflect. Any help on knocking something loose so we can see our changes?
03-30-2021 12:38 PM
Here are some things that you can try to get the update unstuck.
03-30-2021 12:39 PM
Hello Eric,
So yes, that's typically something related to cache. Personally, I recommend Clear Cache chrome extension (https://chrome.google.com/webstore/detail/clear-cache/cppjkneekbjaeellbfkmgnhonkkjfpdn?hl=en). It also exists in FF. In the settings, just keep selected:
BTW, you can add multiple entries on a filter for a slot contribution :
<nuxeo-filter document="[[document]]" permission="Everything,ReadWrite" user="[[user]]">
It will work.
Good luck
05-12-2021 01:23 PM
We were able to figure out how to hide the "Empty Trash" action from all non-admin users. Here is what we did:
Created a new custom element for nuxeo-document-trash-content starting with the default code.
Added a line in that element for
<nuxeo-connection role="widget" user="{{user}}"></nuxeo-connection>
With that, we can filter the code that specifies the "Empty Trash" action (can only use the user.isAdministrator
with the nuxeo-connection
listed above:
<div slot="actions">
<template is="dom-if" if="[[user.isAdministrator]]">
<paper-button noink on-tap="_emptyTrash">[[i18n('documentTrashContent.emptyTrash')]]</paper-button>
</template>
</div>
documentTrashPage
slot content to point to our custom element; and with that our code works as expected (note the order is bumped to 49 from 50 to have it show before the default contribution).<link rel="import" href="elements/nuxeo-results/custom-document-trash-content.html">
<nuxeo-slot-content name="documentTrashPage" slot="DOCUMENT_VIEWS_PAGES" order="49">
<template>
<nuxeo-filter document="[[document]]" facet="Folderish">
<template>
<custom-document-trash-content name="trash" document="[[document]]" provider="advanced_document_content"></custom-document-trash-content>
</template>
</nuxeo-filter>
</template>
</nuxeo-slot-content>
Hope this helps someone else.
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.