[auth_ldap] modify_role has to be called before the update to change it on the backend
This commit is contained in:
parent
84f085f357
commit
06b38b8231
|
@ -10,7 +10,7 @@ from ldap3 import SUBTREE, MODIFY_REPLACE, MODIFY_ADD, MODIFY_DELETE
|
||||||
from werkzeug.exceptions import BadRequest, InternalServerError, NotFound
|
from werkzeug.exceptions import BadRequest, InternalServerError, NotFound
|
||||||
|
|
||||||
from flaschengeist import logger
|
from flaschengeist import logger
|
||||||
from flaschengeist.plugins import AuthPlugin, after_role_updated
|
from flaschengeist.plugins import AuthPlugin, before_role_updated
|
||||||
from flaschengeist.models.user import User, Role, _Avatar
|
from flaschengeist.models.user import User, Role, _Avatar
|
||||||
import flaschengeist.controller.userController as userController
|
import flaschengeist.controller.userController as userController
|
||||||
|
|
||||||
|
@ -47,8 +47,9 @@ class AuthLDAP(AuthPlugin):
|
||||||
self.root_dn = config.get("root_dn", None)
|
self.root_dn = config.get("root_dn", None)
|
||||||
self.root_secret = config.get("root_secret", None)
|
self.root_secret = config.get("root_secret", None)
|
||||||
|
|
||||||
@after_role_updated
|
@before_role_updated
|
||||||
def _role_updated(role, new_name):
|
def _role_updated(role, new_name):
|
||||||
|
logger.debug(f"LDAP: before_role_updated called with ({role}, {new_name})")
|
||||||
self.__modify_role(role, new_name)
|
self.__modify_role(role, new_name)
|
||||||
|
|
||||||
def login(self, user, password):
|
def login(self, user, password):
|
||||||
|
|
Loading…
Reference in New Issue