Don't explicitly allow deleting the current editor's own content

This commit is contained in:
Kenn Jacobsen
2019-06-18 20:58:41 +02:00
committed by Sebastiaan Janssen
parent ef19633a90
commit 9d14c9e0b7

View File

@@ -410,18 +410,7 @@ namespace Umbraco.Web.Trees
internal IEnumerable<MenuItem> GetAllowedUserMenuItemsForNode(IUmbracoEntity dd)
{
var permission = Services.UserService.GetPermissions(Security.CurrentUser, dd.Path);
// TODO: inject
var actions = Current.Actions.FromEntityPermission(permission)
.ToList();
var actionDelete = Current.Actions.GetAction<ActionDelete>();
// A user is allowed to delete their own stuff
var tryGetCurrentUserId = Security.GetUserId();
if (tryGetCurrentUserId && dd.CreatorId == tryGetCurrentUserId.Result && actions.Contains(actionDelete) == false)
actions.Add(actionDelete);
return actions.Select(x => new MenuItem(x));
return Current.Actions.FromEntityPermission(permission).Select(x => new MenuItem(x));
}
/// <summary>