public ActionResult ChildFolders(string folderPath = null) {
            if (!Services.Authorizer.Authorize(Permissions.ManageOwnMedia, T("Cannot get child folder listing")))
                return new HttpUnauthorizedResult();

            // Check permission.
            var rootMediaFolder = _mediaLibraryService.GetRootMediaFolder();
            if (!Services.Authorizer.Authorize(Permissions.ManageMediaContent) && !_mediaLibraryService.CanManageMediaFolder(folderPath)) {
                var model = new MediaManagerChildFoldersViewModel {
                    Children = new IMediaFolder[0]
                };

                return View(model);
            }

            var viewModel = new MediaManagerChildFoldersViewModel {
                Children = _mediaLibraryService.GetMediaFolders(folderPath)
            };

            Response.ContentType = "text/json";
            
            return View(viewModel);
        }
Beispiel #2
0
        public ActionResult ChildFolders(string folderPath = null) {
            if (!Services.Authorizer.Authorize(Permissions.ManageMediaContent, T("Cannot get child folder listing")))
                return new HttpUnauthorizedResult();

            var viewModel = new MediaManagerChildFoldersViewModel {
                Children = _mediaLibraryService.GetMediaFolders(folderPath)
            };

            Response.ContentType = "text/json";
            
            return View(viewModel);
        }