Add support for sudo
This commit is contained in:
@@ -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 })
|
||||
|
||||
Reference in New Issue
Block a user