Merge pull request #1816 from umbraco/temp-u4-9664
u4-9664 - Enables HasAccess on the MediaTreeController to use a udi for checkin…
This commit is contained in:
@@ -207,7 +207,11 @@ namespace Umbraco.Web.Trees
|
||||
return false;
|
||||
}
|
||||
|
||||
IContent content = Services.ContentService.GetById(entity.Id);
|
||||
var content = Services.ContentService.GetById(entity.Id);
|
||||
if (content == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return Security.CurrentUser.HasPathAccess(content);
|
||||
}
|
||||
|
||||
|
||||
@@ -308,7 +308,7 @@ namespace Umbraco.Web.Trees
|
||||
{
|
||||
IUmbracoEntity entity;
|
||||
|
||||
Guid idGuid = Guid.Empty;
|
||||
Guid idGuid;
|
||||
int idInt;
|
||||
Udi idUdi;
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ namespace Umbraco.Web.Trees
|
||||
entity,
|
||||
Constants.ObjectTypes.MediaGuid,
|
||||
parentId,
|
||||
queryStrings,
|
||||
queryStrings,
|
||||
entity.HasChildren && (isContainer == false));
|
||||
|
||||
node.AdditionalData.Add("contentType", entity.ContentTypeAlias);
|
||||
@@ -130,7 +130,7 @@ namespace Umbraco.Web.Trees
|
||||
menu.Items.Add<ActionRefresh>(ui.Text("actions", ActionRefresh.Instance.Alias), true);
|
||||
|
||||
//if the media item is in the recycle bin, don't have a default menu, just show the regular menu
|
||||
if (item.Path.Split(new[] {','}, StringSplitOptions.RemoveEmptyEntries).Contains(RecycleBinId.ToInvariantString()))
|
||||
if (item.Path.Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries).Contains(RecycleBinId.ToInvariantString()))
|
||||
{
|
||||
menu.DefaultMenuAlias = null;
|
||||
}
|
||||
@@ -151,7 +151,13 @@ namespace Umbraco.Web.Trees
|
||||
/// <returns></returns>
|
||||
protected override bool HasPathAccess(string id, FormDataCollection queryStrings)
|
||||
{
|
||||
var media = Services.MediaService.GetById(int.Parse(id));
|
||||
var entity = GetEntityFromId(id);
|
||||
if (entity == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
var media = Services.MediaService.GetById(entity.Id);
|
||||
if (media == null)
|
||||
{
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user