private void AddFolder(Eav.Apps.Assets.Folder fldr) { _folderIds.Add(fldr.Id); // track of the folder AddFilesInFolder(fldr); // keep track of the files foreach (var f in _envFs.GetFolders(fldr.Id, null)) // then add subfolders { AddFolder(f); } }
protected void VerifySecurityAndStructure(Eav.Apps.Assets.Folder <TFolderId, TFileId> parentFolder, IAssetWithParentSysId <TFolderId> target, string errPrefix) { // In case the primary file system is used (usePortalRoot) then also check higher permissions if (AdamContext.UseSiteRoot && !AdamContext.Security.CanEditFolder(target)) { throw HttpException.PermissionDenied(errPrefix + " - permission denied"); } if (!AdamContext.Security.SuperUserOrAccessingItemFolder(target.Path, out var exp)) { throw exp; } if (!EqualityComparer <TFolderId> .Default.Equals(target.ParentSysId, parentFolder.SysId)) { throw HttpException.BadRequest(errPrefix + " - not found in folder"); } }
private void AddFilesInFolder(Eav.Apps.Assets.Folder fldr) => _envFs.GetFiles(fldr.Id, null).ForEach(f => _fileIds.Add(f.Id));
public Export(AdamAppContext adm) { _root = adm.RootFolder; _envFs = adm.EnvironmentFs; }