Release 2.8.2
Publish Docker Image / build-and-push-existing-registry (./build/Dockerfile, web, pulse-signage-web) (push) Successful in 1m12s
Publish Docker Image / build-and-push-existing-registry (./build/Dockerfile.player, player, pulse-signage-player) (push) Successful in 34s

This commit is contained in:
2026-08-16 22:41:39 +01:00
parent a5bf8e6f7f
commit ea72747822
31 changed files with 379 additions and 31 deletions
+19 -3
View File
@@ -1,6 +1,7 @@
// Admin user route registration and user-role management.
const { fetchAppSettings } = require('../../../data/app-settings');
const { fetchAppSettings } = require('#src/data/app-settings');
const { buildAuditChanges } = require('#src/data/audit-log');
module.exports = function registerUsersRoutes(app, deps) {
const pool = deps.pool;
@@ -319,6 +320,8 @@
return res.redirect('/settings/users/' + userId + '/edit?message=' + encodeURIComponent(roleCheck.message));
}
const existingUser = await rbacData.fetchUserWithRoles(pool, userId);
const changes = buildAuditChanges({ roleIds: existingUser ? existingUser.roleIds : [] }, { roleIds: roleCheck.roleIds });
await rbacData.syncUserRoles(pool, userId, roleCheck.roleIds);
if (typeof recordRequestAuditEvent === 'function') {
await recordRequestAuditEvent(pool, req, {
@@ -328,7 +331,7 @@
targetType: 'user',
targetId: userId,
targetLabel: String(userId),
details: { roleIds: roleCheck.roleIds }
details: { changes: changes }
});
}
res.redirect('/settings/users/' + userId + '/edit?message=' + encodeURIComponent('Roles updated.'));
@@ -404,6 +407,19 @@
return renderValidationError('That username already exists.');
}
const changes = buildAuditChanges({
name: user.name,
username: user.username,
roleIds: user.roleIds,
accountLocked: Boolean(user.account_locked),
passwordReset: false
}, {
name: name,
username: username,
roleIds: roleCheck.roleIds,
accountLocked: accountLocked,
passwordReset: shouldUpdatePassword
});
await connection.beginTransaction();
const [result] = await connection.query('UPDATE a_users SET name = ?, username = ?, account_locked = ?, modified_by = ? WHERE id = ?', [name, username, accountLocked ? 1 : 0, getAuditUserId(req), userId]);
if (!result.affectedRows) {
@@ -432,7 +448,7 @@
targetType: 'user',
targetId: userId,
targetLabel: username,
details: { roleIds: roleCheck.roleIds, passwordReset: shouldUpdatePassword, accountLocked: accountLocked }
details: { changes: changes }
});
if (Boolean(user.account_locked) !== accountLocked) {
await recordRequestAuditEvent(pool, req, {