Skip to content

Commit e1e0947

Browse files
committed
Add moderator support to LDAP roles
1 parent a070b55 commit e1e0947

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

routes/auth.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ passport.deserializeUser(function (user, done) {
191191
if (moderators.usernames.indexOf(user.displayName) > -1 ||
192192
moderators.emails.indexOf(user.email) > -1){
193193
user.moderator = true
194+
} else if (moderators.ldap && auth.ldap.enabled &&
195+
user[moderators.ldap.attribute] == moderators.ldap.value){
196+
user.moderator = true;
194197
}
195198
} else {
196199
// If no moderators file supplied everyone is a 'moderator'

0 commit comments

Comments
 (0)