fix: Page Rules based on Tag Matches do not work for comment permissions (#5819)

This commit is contained in:
natsutteatsuiyone authored and GitHub committed 2022-11-07 16:47:42 -05:00
1 parent 1893fd499a
commit 2cb304100c
2 files changed
+18 -6

No files matched your search

+6 -3
View File
@@ -99,7 +99,8 @@ module.exports = class Comment extends Model {
if (page) {
if (!WIKI.auth.checkAccess(user, ['write:comments'], {
path: page.path,
locale: page.localeCode
locale: page.localeCode,
tags: page.tags
})) {
throw new WIKI.Error.CommentPostForbidden()
}
@@ -136,7 +137,8 @@ module.exports = class Comment extends Model {
if (page) {
if (!WIKI.auth.checkAccess(user, ['manage:comments'], {
path: page.path,
locale: page.localeCode
locale: page.localeCode,
tags: page.tags
})) {
throw new WIKI.Error.CommentManageForbidden()
}
@@ -169,7 +171,8 @@ module.exports = class Comment extends Model {
if (page) {
if (!WIKI.auth.checkAccess(user, ['manage:comments'], {
path: page.path,
locale: page.localeCode
locale: page.localeCode,
tags: page.tags
})) {
throw new WIKI.Error.CommentManageForbidden()
}