ensure the user cannot access the media list dashboard if they don't have root access

This commit is contained in:
Shannon
2017-07-31 16:03:31 +10:00
parent 6de2cea9c5
commit b20e3c7435
2 changed files with 11 additions and 5 deletions

View File

@@ -278,8 +278,8 @@ function MediaFolderBrowserDashboardController($rootScope, $scope, $location, co
currentUser = user;
// check if the user start node is the dashboard
if (currentUser.startMediaIds.length === 0 || currentUser.startMediaIds.indexOf(-1) >= 0) {
// check if the user has access to the root which they will require to see this dashboard
if (currentUser.startMediaIds.indexOf(-1) >= 0) {
//get the system media listview
contentTypeResource.getPropertyTypeScaffold(-96)
@@ -303,7 +303,7 @@ function MediaFolderBrowserDashboardController($rootScope, $scope, $location, co
});
} else {
} else if (currentUser.startMediaIds.length > 0){
// redirect to start node
$location.path("/media/media/edit/" + (currentUser.startMediaIds.length === 0 ? -1 : currentUser.startMediaIds[0]));
}

View File

@@ -37,10 +37,16 @@ namespace Umbraco.Web.Models.ContentEditing
/// </summary>
[DataMember(Name = "remainingAuthSeconds")]
public double SecondsUntilTimeout { get; set; }
/// <summary>
/// The user's calculated start nodes based on the start nodes they have assigned directly to them and via the groups they're assigned to
/// </summary>
[DataMember(Name = "startContentIds")]
public int[] StartContentIds { get; set; }
/// <summary>
/// The user's calculated start nodes based on the start nodes they have assigned directly to them and via the groups they're assigned to
/// </summary>
[DataMember(Name = "startMediaIds")]
public int[] StartMediaIds { get; set; }