This is correctly removing 'Delete' from the context menu (when the if evaluates to true), but when rendering the media picker (when the if evaluates to true) it doesn't render any of the sub media folders. It simply shows the 'Media' folder with no sub folders etc. Removing this code makes the media picker behave correctly again.
Is there a quick fix for this? Please let me know.
Problem: removing 'Delete' from the context menu.
Version: 4
.net: 3.5
OS / IIS: 7 / 7
When removing delete from the context menu with the following code:
-------------------------------------------------------------------------------------------------------------------
// use the constructer to wire up the events
EventService()
{
umbraco.cms.presentation.Trees.
(BaseTree_BeforeNodeRender);
}
// Before the loading of each node, we are going to check it and see if it has children and the current user is an admin.
e)
{
//if the current user is an admin or there are no child nodes.. show the delete, otherwise remove it.
.GetCurrent().IsAdmin() )
{
node.Menu.Remove(umbraco.BusinessLogic.Actions.
.Instance);
------------------------------------------------------------------------------------------------------------------------------------------------------
This is correctly removing 'Delete' from the context menu (when the if evaluates to true), but when rendering the media picker (when the if evaluates to true) it doesn't render any of the sub media folders. It simply shows the 'Media' folder with no sub folders etc. Removing this code makes the media picker behave correctly again.
Is there a quick fix for this? Please let me know.
Can't you just use user permissions to remove delete?
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.