s
I need to exclude trash option but only when the menu Item name is "Sites". if so trash option is excluded and if not it remains the same . how can I get the name in order to make this condition?
Can anyone help out?
k
Hi, You can do this with group permissions. Lets assume you have a site with "Sites" and "settings" 1. Go to the users section and select the group you want to no beable to delete things ("Eg editors, but for testing lets do it on admin" - remove the 'delete' option from the permissions (so they can't delete). https://cdn.discordapp.com/attachments/1339326686482665572/1339575365680758928/image.png?ex=67af3847&is=67ade6c7&hm=296cedbb2ab22b36b319a17c4df136ef6663a54468b7764a79d1395a5634404e&
then got to the bottom and add the 'settings' or what ever page you do want them to delete from the bottom (if this is sub folders, of sites then you could pick them) https://cdn.discordapp.com/attachments/1339326686482665572/1339575707474460682/image.png?ex=67af3898&is=67ade718&hm=8e6415f4b3aeec4c4d4fb7bfa8a323e06139a9d7019c6cacaa069ed8820fe304&
and the user will not see trash. at the top level, or but on the ones you have setup.
(its not the code answer, but frankly this code answer won't be simple 😦
(update, i think you need to set all the permission on the child node, as it doesn't inherit)
s
okay. thanks @Kevin Jump . I thought that the code answer is similar to this way: in Oninit function we've got : extensionRegistry.getByAlias("Umb.EntityAction.Document.RecycleBin.Trash") and this removes trash action but from all of the menuItems. so I presumed that with some condition asking if Document type i'm looking for ("sites") appears in the Content sidebar(meaning it was published) so for that menu item disable or remove trash action. but for somehow I can't find the exact way.
k
yeah i think its 'possible' but not really . the OnInit function happens when things are loaded so you can remove it for everything, but to remove it when for speicifc items you would need to intercept the menu render process and i don't think you can (happy to be proven wrong). what you could do, deep breath, is remove the trash entity action, and then write your own entity action to replace it, but define your own custom condition in the manifest for your trash icon, that you could then use to test if the entity action is happening on your 'sites' site, or not and remove the trash icon by failing the condition there. you might not have to write your own trash action, you could have your own trash entity action manifest pointing back at the core trash entity, but with your own custom conditons. so not simple. 😟
s
@Kevin Jump your'e right. thanks anyways! if i'll come up with anything ill let you know
4 Views