Beispiel #1
0
        private string HandleGetPendingTagsInTable(DynamicDictionary _parameters)
        {
            User user;

            if (AuthHelper.IsAuthorized(Request, out user))
            {
                if (user.UserType == UserTypes.SuperUser ||
                    user.UserType == UserTypes.Administrator)
                {
                    HydrantWikiManager hwManager = new HydrantWikiManager();
                    List <Tag>         tags      = hwManager.GetPendingTags();

                    TagTableResponse response = new TagTableResponse {
                        Result = "Success"
                    };

                    foreach (Tag tag in tags)
                    {
                        JsonObjects.ReviewTag jReviewTag = new JsonObjects.ReviewTag(tag);

                        User tagUser = (User)hwManager.GetUser(tag.UserGuid);
                        jReviewTag.Username = tagUser.GetUsernameWithSource();

                        response.Data.Add(jReviewTag);
                    }

                    string json = JsonConvert.SerializeObject(response);

                    return(json);
                }
            }

            return(null);
        }
Beispiel #2
0
        private string HandleGetMyTagsInTable(DynamicDictionary _parameters)
        {
            User user;

            if (AuthHelper.IsAuthorized(Request, out user))
            {
                HydrantWikiManager hwManager = new HydrantWikiManager();
                List <Tag>         tags      = hwManager.GetTagsForUser(user.Guid);

                TagTableResponse response = new TagTableResponse {
                    Result = "Success"
                };

                foreach (Tag tag in tags)
                {
                    JsonObjects.Tag jTag = new JsonObjects.Tag(tag);
                    response.Data.Add(jTag);
                }

                string json = JsonConvert.SerializeObject(response);

                return(json);
            }

            return(null);
        }