Пример #1
0
        public static string GetForumPermission(RestCommand command, int categoryID)
        {
            ForumPermission forumPermission = ForumPermissions.GetForumPermission(command.LoginUser, categoryID);

            if (forumPermission.OrganizationID != command.Organization.OrganizationID)
            {
                throw new RestException(HttpStatusCode.Unauthorized);
            }
            return(forumPermission.GetXml("ForumPermission", true));
        }
Пример #2
0
        public static string GetForumPermissions(RestCommand command)
        {
            ForumPermissions forumPermissions = new ForumPermissions(command.LoginUser);

            forumPermissions.LoadByOrganizationID(command.Organization.OrganizationID);

            if (command.Format == RestFormat.XML)
            {
                return(forumPermissions.GetXml("ForumPermissions", "ForumPermission", true, command.Filters));
            }
            else
            {
                throw new RestException(HttpStatusCode.BadRequest, "Invalid data format");
            }
        }