예제 #1
0
        public override void BuildDynamicFolders(PathIdentifier identifier, ItemQueryResponse page, FolderModel folder, bool isRestrictedView = false)
        {
            if (EDiscoveryUtility.IsUserEDiscovery(connection.UserAccessIdentifiers) ||
                LEOUploadUtility.IsUserLeo(connection.UserAccessIdentifiers))
            {
                return;
            }

            var logPathIdentifier = new PathIdentifier(identifier)
            {
                PathKey = LOG_READER_PATH_KEY
            };

            if (page.PathTree.Paths == null)
            {
                page.PathTree.Paths = new List <ManagerPathModel>();
            }

            // Last the parent / root node of 'eDiscovery'
            var logPath = new ManagerPathModel
            {
                Identifier        = logPathIdentifier,
                Icons             = new string[] { "fa-history" },
                Name              = "Logs",
                FullPath          = LOG_READER_PATH_KEY,
                AllowedOperations = null,
                Paths             = new List <ManagerPathModel>(),
                IsExpanded        = false
            };

            page.PathTree.Paths.Add(logPath);
        }
예제 #2
0
        protected virtual async Task Initialize(PathIdentifier identifier)
        {
            state = await pathService.OpenFolder(identifier);

            page = new ItemQueryResponse
            {
                PathName = identifier.LeafName,
                PathTree = state.Paths.Root,
            };

            if (state.Folder != null)
            {
                var caseNumber = state.Folder.Read <string>("attribute.casenumber");
                var lastName   = state.Folder.Read <string>("attribute.lastname");

                if (lastName != null)
                {
                    if (caseNumber != null)
                    {
                        page.PathTree.Name = $"{lastName} ({caseNumber})";
                    }
                    else
                    {
                        page.PathTree.Name = lastName;
                    }
                }
            }

            filteredFiles = state.Folder.Files.Rows as IEnumerable <FileModel>; //A collection of files that we will use to build up our response.
        }
        protected override async Task Initialize(PathIdentifier identifier)
        {
            state = await pathService.OpenFolder(identifier, true);

            page = new ItemQueryResponse
            {
                PathName = identifier.LeafName,
                PathTree = state.Paths.Root,
            };
            // Only add an audit log entry if the user accessed a package. If full path == null, then they're hitting "Case Files"
            if (!String.IsNullOrEmpty(identifier.FullName))
            {
                await this.auditLogStore.AddEntry(
                    new AuditLogEntry()
                {
                    EntryType  = AuditLogEntryType.eDiscoveryUserPackageAccess,
                    Message    = $"User Accessed Package: \"{identifier.PathKey.Replace(EDiscoveryUtility.E_DISCOVERY_PATH_NAME + "/", "")}\" ",
                    ModuleType = ModuleType.eDiscovery
                },
                    identifier as FolderIdentifier
                    );
            }

            filteredFiles = state.Folder.Files.Rows as IEnumerable <FileModel>; //A collection of files that we will use to build up our response.
        }
예제 #4
0
        public override void OnResponse(ItemQueryResponse response, PathIdentifier pathIdentifier)
        {
            var leoUploadPath = new PathIdentifier(pathIdentifier as FolderIdentifier, LEOUploadUtility.LEO_UPLOAD_PATH_KEY);

            if (pathIdentifier.IsChildOf(leoUploadPath) && response.AllowedOperations != null)
            {
                if (!LEOUploadUtility.IsUserLeo(connection.UserAccessIdentifiers))
                {
                    response.AllowedOperations = response.AllowedOperations.Where(a => !(a.BatchOperation is UploadRequest));
                }
            }
        }
예제 #5
0
        protected override async Task Initialize(PathIdentifier identifier)
        {
            if (LEOUploadUtility.IsUserLeo(connection.UserAccessIdentifiers))
            {
                OfficerPathIdentifier = await LEOUploadModule.GetOfficerPathAsync(identifier);

                IsLEOUser = true;
            }

            state = await pathService.OpenFolder(identifier, false);

            page = new ItemQueryResponse
            {
                PathName = identifier.LeafName,
                PathTree = state.Paths.Root,
            };

            filteredFiles = state.Folder.Files.Rows as IEnumerable <FileModel>; //A collection of files that we will use to build up our response.
        }
예제 #6
0
 protected virtual void BuildDynamicFolders(List <IModule> activeModules, PathIdentifier identifier, ItemQueryResponse page, FolderModel folder)
 {
     foreach (var module in activeModules)
     {
         // False here signals that this is not the restricted view.  So for instance with eDiscovery the not shared yet folder will be included.
         module.BuildDynamicFolders(identifier, page, state.Folder, false);
     }
 }
예제 #7
0
        public override void BuildDynamicFolders(PathIdentifier identifier, ItemQueryResponse page, FolderModel folder, bool isRestrictedView = false)
        {
            if (!isRestrictedView)
            {
                var leoUploadRootIdentifier = new PathIdentifier(identifier)
                {
                    PathKey = LEOUploadUtility.LEO_UPLOAD_PATH_KEY
                };


                // If it hasn't been added then it's going to be generated dynamically like this.
                if (!page?.PathTree?.Paths?.Any(p => p.Identifier.PathKey == LEOUploadUtility.LEO_UPLOAD_PATH_KEY) ?? false)
                {
                    if (page.PathTree.Paths == null)
                    {
                        page.PathTree.Paths = new List <ManagerPathModel>();
                    }

                    // Last the parent / root node of 'eDiscovery'
                    var leoUploadPath = new ManagerPathModel
                    {
                        Identifier        = leoUploadRootIdentifier,
                        Icons             = new string[] { LEOUploadUtility.LEO_UPLOAD_FOLDER_COLOR_STYLE },
                        Name              = LEOUploadUtility.LEO_UPLOAD_PATH_NAME,
                        FullPath          = LEOUploadUtility.LEO_UPLOAD_PATH_KEY,
                        AllowedOperations = null,
                        Paths             = new List <ManagerPathModel>(),
                        IsExpanded        = false // TODO: Put in the real logic here.
                    };

                    page.PathTree.Paths.Add(leoUploadPath);
                }
                else
                {
                    // In this case it already exists in the path tree, we're going to move it around, and alter some of it's properties.
                    // this also means that there's a child folder for an officer underneath the LEO Upload path.
                    // This is also where you might want to put some ordering in place.
                    var leoUploadManagerPath = page.PathTree.Paths.Where(path => path.Identifier.PathKey == LEOUploadUtility.LEO_UPLOAD_PATH_KEY).FirstOrDefault();

                    // Now that we have the path, we're going to do things like change it's icon color.
                    if (leoUploadManagerPath != null)
                    {
                        leoUploadManagerPath.Icons             = new string[] { LEOUploadUtility.LEO_UPLOAD_FOLDER_COLOR_STYLE };
                        leoUploadManagerPath.AllowedOperations = null;
                        leoUploadManagerPath.IsExpanded        = true;
                    }

                    // We also want to color all the children blue as well.
                    foreach (var child in leoUploadManagerPath.Paths)
                    {
                        child.Icons = new string[] { LEOUploadUtility.LEO_UPLOAD_FOLDER_COLOR_STYLE };
                    }

                    // Now we need to move this order around.
                    page.PathTree.Paths.Remove(leoUploadManagerPath);

                    page.PathTree.Paths.Add(leoUploadManagerPath);
                }

                RecurseTree(page.PathTree, path =>
                {
                    if (path.Identifier.IsChildOf(leoUploadRootIdentifier) && (path.AllowedOperations?.Any() ?? false))
                    {
                        path.AllowedOperations = path.AllowedOperations.Where(a => !(a.BatchOperation is MoveIntoRequest));
                    }
                });
            }
        }
 protected override void BuildDynamicFolders(List <IModule> activeModules, PathIdentifier identifier, ItemQueryResponse page, FolderModel folder)
 {
     foreach (var module in activeModules)
     {
         // true here means that this is a restricted view, so for things like EDiscovery the not shared yet folder will not be included.
         module.BuildDynamicFolders(identifier, page, state.Folder, true);
     }
 }
예제 #9
0
        public override void BuildDynamicFolders(PathIdentifier identifier, ItemQueryResponse page, FolderModel folder, bool isRestrictedView)
        {
            if (!page?.PathTree?.Paths?.Any(p => p.Identifier.PathKey == EDiscoveryUtility.E_DISCOVERY_PATH_KEY) ?? false)
            {
                if (page.PathTree.Paths == null)
                {
                    page.PathTree.Paths = new List <ManagerPathModel>();
                }

                var managerPathModels = new List <ManagerPathModel>();

                // we have to build up the children first.
                // First we get all the dated package dynamic paths.
                var datedPackagePaths = BuildDatedPackagesDynamicFolder(folder);

                var eDiscoveryIdentifier = new PathIdentifier(identifier)
                {
                    PathKey = EDiscoveryUtility.E_DISCOVERY_PATH_KEY
                };

                // Last the parent / root node of 'eDiscovery'
                var eDiscoveryPath = new ManagerPathModel
                {
                    Identifier        = eDiscoveryIdentifier,
                    Icons             = new string[] { EDiscoveryUtility.EDISCOVERY_FOLDER_COLOR_STYLE },
                    Name              = EDiscoveryUtility.E_DISCOVERY_PATH_NAME,
                    FullPath          = EDiscoveryUtility.E_DISCOVERY_PATH_KEY,
                    AllowedOperations = null,
                    Paths             = new List <ManagerPathModel>(),
                    IsExpanded        = datedPackagePaths.Count > 0 || EDiscoveryUtility.GetStagedCount(folder) > 0,
                };

                if (datedPackagePaths.Any())
                {
                    var allPackagesIdentifier = new PathIdentifier(identifier as FolderIdentifier, EDiscoveryUtility.E_DISCOVERY_ALL_PACKAGE_PATH_KEY);

                    var packageName = "All";

                    var processor = new PathProcessor(folder.Identifier);
                    processor.Read(folder, skipFolderPaths: true, pathReader: f => {
                        var sharePath = f.MetaEDiscoveryPathIdentifierRead();

                        if (sharePath != null)
                        {
                            return(allPackagesIdentifier.CreateChild(sharePath.PathKey));
                        }
                        else
                        {
                            return(sharePath);
                        }
                    });


                    datedPackagePaths.Insert(0, new EDiscoveryManagerPathModel()
                    {
                        Identifier = allPackagesIdentifier,
                        Icons      = new string[] { EDiscoveryUtility.EDISCOVERY_FOLDER_COLOR_STYLE },
                        Name       = packageName,
                        FullPath   = allPackagesIdentifier.FullName,
                        Paths      = processor[allPackagesIdentifier]?.Paths
                    });
                }

                eDiscoveryPath.Paths = eDiscoveryPath.Paths.Concat(datedPackagePaths).ToList();

                if (!isRestrictedView)
                {
                    eDiscoveryPath.Paths.Add(GetNotSharedYetPath(folder));
                }

                page.PathTree.Paths.Add(eDiscoveryPath);
            }
        }
예제 #10
0
 public virtual void OnResponse(ItemQueryResponse response, PathIdentifier pathIdentifier)
 {
 }
예제 #11
0
 public virtual void BuildDynamicFolders(PathIdentifier identifier, ItemQueryResponse page, FolderModel folder, bool isRestrictedView = false)
 {
     // No op in the base case.
 }
예제 #12
0
        protected override void BuildDynamicFolders(List <IModule> activeModules, PathIdentifier identifier, ItemQueryResponse page, FolderModel folder)
        {
            base.BuildDynamicFolders(activeModules, identifier, page, folder);

            if (IsLEOUser)
            {
                SecurityPrunePaths(page.PathTree);
            }
        }