private string GetThreadUrl(Page page, bool authenticated, ForumAction action, ForumThread thread) { string url = null; IUrlHelper urlHelper = _urlHelperFactory.GetUrlHelper(_actionContextAccessor.ActionContext); switch (action) { case ForumAction.ReplyThread: url = urlHelper.PageUrl(page, thread.Subject, new { forumaction = "replythread", threadid = thread.ThreadId }); break; case ForumAction.QuoteThread: url = urlHelper.PageUrl(page, thread.Subject, new { forumaction = "quotethread", threadid = thread.ThreadId }); break; case ForumAction.UpdateThread: url = urlHelper.PageUrl(page, thread.Subject, new { forumaction = "updatethread", threadid = thread.ThreadId }); break; case ForumAction.DeleteThread: url = urlHelper.PageUrl(page, thread.Subject, new { forumaction = "deletethread", threadid = thread.ThreadId }); break; } return(GetAuthenticatedUrl(urlHelper, url, authenticated)); }
private string GetPostUrl(Page page, bool authenticated, ForumAction action, ForumThread thread, ForumPost post) { string url = null; IUrlHelper urlHelper = _urlHelperFactory.GetUrlHelper(_actionContextAccessor.ActionContext); switch (action) { case ForumAction.ReplyPost: url = urlHelper.PageUrl(page, thread.Subject, new { forumaction = "replypost", threadid = thread.ThreadId, postid = post.PostId }); break; case ForumAction.QuotePost: url = urlHelper.PageUrl(page, thread.Subject, new { forumaction = "quotepost", threadid = thread.ThreadId, postid = post.PostId }); break; case ForumAction.UpdatePost: url = urlHelper.PageUrl(page, thread.Subject, new { forumaction = "updatepost", threadid = thread.ThreadId, postid = post.PostId }); break; } return(GetAuthenticatedUrl(urlHelper, url, authenticated)); }
public SecurityAccessEventArgs(ForumAction action, object targetObject) { this.Action = action; this.TargetObject = targetObject; }
public bool ValidateAccessSecurityAction(ForumAction forumAction, object targetObject) { _securityValidator.OnValidate(new SecurityAccessEventArgs(forumAction, targetObject)); return(_securityValidator.IsAccessible); }
public bool ValidateAccessSecurityAction(ForumAction forumAction, object targetObject) { _securityValidator.OnValidate(new SecurityAccessEventArgs(forumAction, targetObject)); return _securityValidator.IsAccessible; }