/// <inheritdoc /> public void SaveFolderDetails(IFolderInfo folder, FolderDetailsRequest folderDetails) { this.assetManager.RenameFolder(folderDetails.FolderId, folderDetails.FolderName); folder.FolderPermissions.Clear(); folder.FolderPermissions.AddRange(folderDetails.Permissions.RolePermissions.ToPermissionInfos(folderDetails.FolderId)); folder.FolderPermissions.AddRange(folderDetails.Permissions.UserPermissions.ToPermissionInfos(folderDetails.FolderId)); FolderManager.Instance.UpdateFolder(folder); }
public HttpResponseMessage SaveFolderDetails(FolderDetailsRequest folderDetails) { var folder = FolderManager.Instance.GetFolder(folderDetails.FolderId); if (folder == null) { return(this.Request.CreateResponse(HttpStatusCode.NotFound, new { message = "Folder doesn't exist." })); } if (!FolderPermissionController.CanManageFolder((FolderInfo)folder)) { return(this.Request.CreateResponse( HttpStatusCode.InternalServerError, new { message = LocalizationHelper.GetString("UserHasNoPermissionToManageFolder.Error") })); } ItemsManager.Instance.SaveFolderDetails(folder, folderDetails); return(this.Request.CreateResponse(HttpStatusCode.OK, new { Status = 0 })); }