mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-22 07:40:32 +00:00
fix(server): premissions guard for read and write endpoints
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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, {
|
||||
|
||||
Reference in New Issue
Block a user