Super user is not a Zero

This commit is contained in:
Stephan
2018-03-02 15:48:21 +01:00
parent 20a7d9926b
commit 030c97ef26
22 changed files with 119 additions and 77 deletions

View File

@@ -352,7 +352,8 @@ namespace Umbraco.Web.Trees
.ToList();
// A user is allowed to delete their own stuff
if (dd.CreatorId == Security.GetUserId() && actions.Contains(ActionDelete.Instance) == false)
var tryGetCurrentUserId = Security.GetUserId();
if (tryGetCurrentUserId && dd.CreatorId == tryGetCurrentUserId.Result && actions.Contains(ActionDelete.Instance) == false)
actions.Add(ActionDelete.Instance);
return actions.Select(x => new MenuItem(x));