Skip to content

Commit

Permalink
fix: apply locale restrictions to page rules
Browse files Browse the repository at this point in the history
  • Loading branch information
NGPixel committed Feb 21, 2022
1 parent 411802e commit a3bf1f7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/core/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down

0 comments on commit a3bf1f7

Please sign in to comment.