public ActionResult UnarchivePM(int id) { var user = _userRetrievalShim.GetUser(HttpContext); if (user == null) { return(Forbid()); } var pm = _privateMessageService.Get(id); if (!_privateMessageService.IsUserInPM(user, pm)) { return(Forbid()); } _privateMessageService.Unarchive(user, pm); return(RedirectToAction("Archive")); }
public ActionResult UnarchivePM(int id) { var user = this.CurrentUser(); if (user == null) { return(this.Forbidden("Forbidden", null)); } var pm = _privateMessageService.Get(id); if (!_privateMessageService.IsUserInPM(user, pm)) { return(this.Forbidden("Forbidden", null)); } _privateMessageService.Unarchive(user, pm); return(RedirectToAction("Archive")); }
public async Task <ActionResult> UnarchivePM(int id) { var user = _userRetrievalShim.GetUser(); if (user == null) { return(StatusCode(403)); } var pm = await _privateMessageService.Get(id); if (await _privateMessageService.IsUserInPM(user, pm) == false) { return(StatusCode(403)); } await _privateMessageService.Unarchive(user, pm); return(RedirectToAction("Archive")); }