private FileModel FilterAccessibleFolderAndFiles(String virtualPath, String userName) { FileModel fileModel = null; AuthenticationsAndAuthorizationsOperations aNaOps = new AuthenticationsAndAuthorizationsOperations(); DocumentsOperations docOps = new DocumentsOperations(); FileModel commonFileModel = new FileModel(UtilityOperations.GetDockerCommonFolderPath(), ""); if (!aNaOps.IsSystemAdministratorUser(userName) && !aNaOps.IsDMSAdministratorUser(userName)) { fileModel = new FileModel(virtualPath, "/" + userName); List <String> dbFilesVPath = docOps.GetFilesByUserName(userName).Select(file => file.VirtualPath).ToList(); if (fileModel.IsRootDir) { fileModel.CommonFolderFiles = commonFileModel.CurrentFolderFiles.Where(file => dbFilesVPath.Contains(file.VirtualPath)).ToList(); } else { fileModel.CommonFolderFiles = new List <FileModel>(); } fileModel.Tags = docOps.GetAllTagsByUserId(aNaOps.GetUserIDByUserName(userName)); } else { fileModel = new FileModel(virtualPath, ""); String[] usersPath = docOps.GetAllUsersFolderInArray(UtilityOperations.GetDockerRootPath() + "/"); foreach (FileModel file in fileModel.CurrentFolderFiles) { if (usersPath.Contains(file.VirtualPath)) { file.IsUserFolder = true; } } if (fileModel.IsRootDir) { fileModel.CommonFolderFiles = commonFileModel.CurrentFolderFiles; } else { fileModel.CommonFolderFiles = new List <FileModel>(); } fileModel.Tags = docOps.GetAllTagsByUserId(aNaOps.GetUserIDByUserName(userName)); } return(fileModel); }