Ejemplo n.º 1
0
        public HttpResponseMessage LoadFiles(FolderItemDTO folderItem)
        {
            int effectivePortalId = PortalSettings.PortalId;

            if (string.IsNullOrEmpty(folderItem.FolderPath))
            {
                folderItem.FolderPath = "";
            }

            if (IsUserFolder(folderItem.FolderPath))
            {
                if (!UserInfo.IsSuperUser)
                {
                    effectivePortalId = PortalController.GetEffectivePortalId(effectivePortalId);
                }
                else
                {
                    effectivePortalId = -1;
                }
            }

            var list      = Globals.GetFileList(effectivePortalId, folderItem.FileFilter, !folderItem.Required, folderItem.FolderPath);
            var fileItems = list.OfType <FileItem>().ToList();

            return(Request.CreateResponse(HttpStatusCode.OK, fileItems));
        }
Ejemplo n.º 2
0
        public HttpResponseMessage LoadFiles(FolderItemDTO folderItem)
        {
            int effectivePortalId = PortalSettings.PortalId;
            if (string.IsNullOrEmpty(folderItem.FolderPath))
            {
                folderItem.FolderPath = "";
            }

            int userId;
            if (IsUserFolder(folderItem.FolderPath, out userId))
            {
                var user = UserController.GetUserById(effectivePortalId, userId);
                if (user != null && user.IsSuperUser)
                {
                    effectivePortalId = Null.NullInteger;
                }
                else
                {
                    effectivePortalId = PortalController.GetEffectivePortalId(effectivePortalId);
                }
            }

            var list = Globals.GetFileList(effectivePortalId, folderItem.FileFilter, !folderItem.Required, folderItem.FolderPath);
            var fileItems = list.OfType<FileItem>().ToList();

            return Request.CreateResponse(HttpStatusCode.OK, fileItems);
        }
Ejemplo n.º 3
0
        public HttpResponseMessage LoadFiles(FolderItemDTO folderItem)
        {
            int effectivePortalId = PortalSettings.PortalId;

            if (string.IsNullOrEmpty(folderItem.FolderPath))
            {
                folderItem.FolderPath = string.Empty;
            }

            int userId;

            if (IsUserFolder(folderItem.FolderPath, out userId))
            {
                var user = UserController.GetUserById(effectivePortalId, userId);
                if (user != null && user.IsSuperUser)
                {
                    effectivePortalId = Null.NullInteger;
                }
                else
                {
                    effectivePortalId = PortalController.GetEffectivePortalId(effectivePortalId);
                }
            }

            var list      = Globals.GetFileList(effectivePortalId, folderItem.FileFilter, !folderItem.Required, folderItem.FolderPath);
            var fileItems = list.OfType <FileItem>().ToList();

            return(Request.CreateResponse(HttpStatusCode.OK, fileItems));
        }