Merge branch 'v8/dev' of https://github.com/umbraco/Umbraco-CMS into v8/dev

This commit is contained in:
Sebastiaan Janssen
2019-06-27 13:48:43 +02:00
2 changed files with 7 additions and 13 deletions

View File

@@ -174,7 +174,12 @@ namespace Umbraco.Web.PropertyEditors
// more magic here ;-(
var configuration = dataTypeService.GetDataType(propertyType.DataTypeId).ConfigurationAs<ImageCropperConfiguration>();
var crops = configuration?.Crops ?? Array.Empty<ImageCropperConfiguration.Crop>();
return "{src: '" + val + "', crops: " + crops + "}";
return JsonConvert.SerializeObject(new
{
src = val,
crops = crops
});
}
}
}

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>