Allow admins to manage user passwords

This commit is contained in:
Cauê Faleiros
2026-06-09 14:26:00 -03:00
parent 40c7807a65
commit f77ee406ec
5 changed files with 121 additions and 18 deletions

View File

@@ -23,6 +23,7 @@ const canUpdateUser = (actor, targetUser) => {
const canManageUserStatus = (actor) => actor.role === 'super_admin' || actor.role === 'admin';
const canChangeUserEmail = (actor, targetUser) => actor.id === targetUser.id || actor.role === 'super_admin' || actor.role === 'admin';
const canManageUserRoleOrTeam = (actor) => actor.role === 'super_admin' || actor.role === 'admin';
const canManageUserPassword = (actor) => actor.role === 'super_admin' || actor.role === 'admin';
const canReadAttendance = (actor, attendance) => {
if (!actor || !attendance || !sameTenant(actor, attendance)) return false;
@@ -38,5 +39,6 @@ module.exports = {
canManageUserStatus,
canChangeUserEmail,
canManageUserRoleOrTeam,
canManageUserPassword,
canReadAttendance,
};