mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-04-05 21:01:35 +08:00
Comments from the site owner or administrator should not need moderation
Work Item: 16643 --HG-- branch : dev
This commit is contained in:
parent
8efaf1ca20
commit
5d350688bb
@ -50,8 +50,15 @@ namespace Orchard.Comments.Controllers {
|
||||
|
||||
CommentPart commentPart = _commentService.CreateComment(context, Services.WorkContext.CurrentSite.As<CommentSettingsPart>().Record.ModerateComments);
|
||||
|
||||
if (commentPart.Record.Status == CommentStatus.Pending)
|
||||
Services.Notifier.Information(T("Your comment will appear after the site administrator approves it."));
|
||||
if (commentPart.Record.Status == CommentStatus.Pending) {
|
||||
// if the user who submitted the comment has the right to moderate, don't make this comment moderated
|
||||
if (Services.Authorizer.Authorize(Permissions.ManageComments)) {
|
||||
commentPart.Record.Status = CommentStatus.Approved;
|
||||
}
|
||||
else {
|
||||
Services.Notifier.Information(T("Your comment will appear after the site administrator approves it."));
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
foreach (var error in ModelState.Values.SelectMany(m => m.Errors).Select( e=> e.ErrorMessage)) {
|
||||
|
Loading…
Reference in New Issue
Block a user