feat(auth): implement role-based access control and user management features

This commit is contained in:
Nils-Johan Gynther
2026-04-18 09:34:22 +02:00
parent 20330f6410
commit c5ccef2313
22 changed files with 358 additions and 10 deletions
+11
View File
@@ -20,4 +20,15 @@ export class UsersService {
updateProfile(id: number, data: { firstName?: string; lastName?: string; email?: string }) {
return this.prisma.user.update({ where: { id }, data });
}
findAll() {
return this.prisma.user.findMany({
select: { id: true, username: true, email: true, firstName: true, lastName: true, role: true, createdAt: true },
orderBy: { username: 'asc' },
});
}
setRole(id: number, role: string) {
return this.prisma.user.update({ where: { id }, data: { role } });
}
}