Remove ldap:Group model
This commit is contained in:
@@ -14,7 +14,7 @@ class GroupsController extends LDAPController {
|
||||
|
||||
constructor() {
|
||||
super()
|
||||
this.Group = this.models.get('ldap:Group')
|
||||
this.Group = this.models.get('auth:Group')
|
||||
}
|
||||
|
||||
// TODO flitter-orm chunk query
|
||||
@@ -106,7 +106,7 @@ class GroupsController extends LDAPController {
|
||||
async get_resource_from_dn(dn) {
|
||||
const cn = this.get_cn_from_dn(dn)
|
||||
if ( cn ) {
|
||||
return this.Group.findOne({name: cn, ldap_visible: true})
|
||||
return this.Group.findOne({name: cn, ldap_visible: true, active: true})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,13 @@ class UsersController extends LDAPController {
|
||||
// Might need to override compare to support special handling for userPassword
|
||||
|
||||
// TODO generalize some of the addition logic
|
||||
// TODO rework some of the registration and validation logic
|
||||
async add_people(req, res, next) {
|
||||
const Setting = this.models.get('Setting')
|
||||
if ( !(await Setting.get('auth.allow_registration')) ) {
|
||||
return next(new LDAP.InsufficientAccessRightsError('Operation not enabled.'))
|
||||
}
|
||||
|
||||
if ( !req.user.can('ldap:add:users') ) {
|
||||
return next(new LDAP.InsufficientAccessRightsError())
|
||||
}
|
||||
@@ -87,6 +93,7 @@ class UsersController extends LDAPController {
|
||||
}
|
||||
|
||||
// TODO generalize some of the modification logic
|
||||
// TODO rework validation
|
||||
async modify_people(req, res, next) {
|
||||
if ( !req.user.can('ldap:modify:users') ) {
|
||||
return next(new LDAP.InsufficientAccessRightsError())
|
||||
|
||||
Reference in New Issue
Block a user