Comment Moderation Permissions

Topics: ASP.NET 2.0
Jan 4, 2010 at 6:06 PM

Can someone please explain if there is a way for me to give an editor permission to moderate comments within the Blog. I am running BlogEngine.NET 1.5.0.7

Coordinator
Jan 5, 2010 at 6:01 AM

I think there's only one change needed.

In the BE core files, in CommentViewBase.cs (in the Web\Controls) folder.  There is this line of code within "AdminLinks":

if (Page.User.IsInRole(BlogSettings.Instance.AdministratorRole) || Page.User.Identity.Name.Equals(Post.Author))

... you would want to change that to:

if (Page.User.Identity.IsAuthenticated)

... and recompile the BE core to produce a new BlogEngine.Core.dll file for your BIN folder.

Jan 7, 2010 at 4:00 PM

Ben,

Thank you very much for the response. However, in reviewing the code in the suggested file, it appears to me that only allows a user to delete comments. I am interested in the ability for a editor to delete comments. However, I am more interested in the ability for them to approve comments. Can you, or someone else, please explain how this could be handled?

Also, I suppose this could be considered as a feature request. I think it would really be great if BlogEngine was setup to allow the end user to create permission groups and assign a user to the said group. Further, to allow the end user (administartor) to assign only specific permissions to a user would be great. What does everyone else think? Where should I post feature requests?

Coordinator
Jan 7, 2010 at 4:15 PM

By making that change, that would allow both editors and administrators to receive all the extra admin functionality for each comment.  That is: (a) see the email address of the commenter, (b) see the IP address of the commenter, (c) delete the comment and (d) approve the comment.

The best way to suggest a feature request is in the Issue Tracker.  Anyone can Vote for items in the Issue Tracker.