Example #1
0
        /// <summary>
        /// Loads the file library acl.
        /// </summary>
        /// <param name="entity">The entity.</param>
        /// <returns></returns>
        private bool LoadFileLibraryAcl(WorkflowInstanceEntity entity, out FileStorage fs, out AccessControlList acl)
        {
            acl = null;
            fs  = null;

            // Resolve ContainerKey
            string containerName = "FileLibrary";
            string containerKey  = string.Empty;

            if (entity.OwnerDocumentId.HasValue)
            {
                containerKey = UserRoleHelper.CreateDocumentContainerKey(entity.OwnerDocumentId.Value);
            }
            //else
            // TODO: Extend Owner Processing

            // Check ContainerKey
            if (string.IsNullOrEmpty(containerKey))
            {
                return(false);
            }

            // Open ACL
            BaseIbnContainer bic = BaseIbnContainer.Create(containerName, containerKey);

            fs = (FileStorage)bic.LoadControl("FileStorage");

            acl = AccessControlList.GetACL(fs.Root.Id);

            return(true);
        }