Add support for sudo
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone Build is passing

This commit is contained in:
2021-03-10 23:43:16 -06:00
parent 3d2c4c0fec
commit 943c30fa96
6 changed files with 182 additions and 0 deletions

View File

@@ -59,6 +59,17 @@ class GroupModel extends Model {
}
}
static async sudo_directory() {
const groups = await this.find({ ldap_visible: true, active: true, grants_sudo: true })
let users = []
for ( const group of groups ) {
users = [...users, ...(await group.users())]
}
return users
}
static async ldap_directory() {
const User = this.prototype.models.get('auth:User')
const groups = await this.find({ ldap_visible: true, active: true })