Beispiel #1
0
        public async Task <IActionResult> Sub(string id)
        {
            var model = new HomeSubViewModel();

            if (_load.CheckLock(id))
            {
                if (User.Identity.Name != null)
                {
                    var access = _load.GetFA(id, User.Identity.Name);
                    var authorizationResult = await _authorizationService.AuthorizeAsync(User, access, new EditRequirements());

                    if (authorizationResult.Succeeded)
                    {
                        model.Posts = _load.GetPosts(id);
                        model.FId   = model.Posts.FirstOrDefault();
                        return(View(model));
                    }
                    var reqForum = _load.GetForum(id);
                    return(RedirectToAction("RequestAccess", reqForum));
                }
                return(View("AccessDenied"));
            }
            model.Posts = _load.GetPosts(id);
            model.FId   = model.Posts.FirstOrDefault();
            return(View(model));
        }
Beispiel #2
0
        public IActionResult Sub(string id)
        {
            var model = new HomeSubViewModel();

            model.Posts = _load.GetPosts(id);
            model.FId   = model.Posts.FirstOrDefault();
            return(View(model));
        }