styles bugfix

This commit is contained in:
2026-05-07 15:28:26 +02:00
parent e5ee067db4
commit c848633a1f
8 changed files with 371 additions and 122 deletions

View File

@@ -1,9 +1,11 @@
const jwt = require('jsonwebtoken');
const sequelize = require('sequelize');
class RBACManager {
constructor(databaseModel, SECRET_KEY) {
constructor(databaseModel, SECRET_KEY, service) {
this.db = databaseModel;
this.SECRET_KEY = SECRET_KEY;
this.service = service;
}
async resolvePermissions(objectGuid) {
@@ -246,6 +248,29 @@ async getAuth() {
return await Auth.findAll({ raw: true });
}
async syncAuthByActiveDirectory() {
const auth = await this.db.get('authentication');
const all = await this.service.get('activeDirectoryManager').getAllUsers();
await Promise.all(
all.map(async (user) => {
user = {...user, userAccountControl_ID: user.userAccountControl};
const [record, created] = await auth.findOrCreate({
where: { dn: user.dn },
defaults: user
});
if (!created) {
await record.update(user);
}
})
);
// return all;
}
async createAuth(data) {
const Auth = this.db.get('authentication');
@@ -429,7 +454,6 @@ async getPermission() {
return await permission.findAll({ raw: true }) || [];
}
async createPermission(data) {
const Permission = this.db.get('permissionModel');