From a3bf1f7916e0964db669cd2aaded56d3fdd9f35d Mon Sep 17 00:00:00 2001 From: NGPixel Date: Sun, 20 Feb 2022 19:33:19 -0500 Subject: [PATCH] fix: apply locale restrictions to page rules --- server/core/auth.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/core/auth.js b/server/core/auth.js index 8686fbee..56f32b3e 100644 --- a/server/core/auth.js +++ b/server/core/auth.js @@ -241,6 +241,9 @@ module.exports = { user.groups.forEach(grp => { const grpId = _.isObject(grp) ? _.get(grp, 'id', 0) : grp _.get(WIKI.auth.groups, `${grpId}.pageRules`, []).forEach(rule => { + if (rule.locales && rule.locales.length > 0) { + if (!rule.locales.includes(page.locale)) { return } + } if (_.intersection(rule.roles, permissions).length > 0) { switch (rule.match) { case 'START':