Unverified Commit a3bf1f79 authored by NGPixel's avatar NGPixel

fix: apply locale restrictions to page rules

parent 411802ec
...@@ -241,6 +241,9 @@ module.exports = { ...@@ -241,6 +241,9 @@ module.exports = {
user.groups.forEach(grp => { user.groups.forEach(grp => {
const grpId = _.isObject(grp) ? _.get(grp, 'id', 0) : grp const grpId = _.isObject(grp) ? _.get(grp, 'id', 0) : grp
_.get(WIKI.auth.groups, `${grpId}.pageRules`, []).forEach(rule => { _.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) { if (_.intersection(rule.roles, permissions).length > 0) {
switch (rule.match) { switch (rule.match) {
case 'START': case 'START':
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment