fix(server): premissions guard for read and write endpoints

This commit is contained in:
Ahmed Bouhuolia
2026-02-15 22:55:10 +02:00
parent af80afcf59
commit 2d39e38578
31 changed files with 423 additions and 21 deletions

View File

@@ -22,7 +22,7 @@ export class UsersController {
/**
* Edit details of the given user.
*/
@Post(':id')
@Put(':id')
@ApiOperation({ summary: 'Edit details of the given user.' })
@ApiResponse({
status: 200,

View File

@@ -43,11 +43,11 @@ export class InactivateUserService {
// Throw serivce error if the user is already inactivated.
this.throwErrorIfUserInactive(tenantUser);
// Marks the tenant user as active.
// Marks the tenant user as inactive.
await this.tenantUserModel()
.query()
.findById(userId)
.update({ active: true });
.update({ active: false });
// Triggers `onTenantUserActivated` event.
await this.eventEmitter.emitAsync(events.tenantUser.onInactivated, {