|
|
@ -10,10 +10,12 @@ import { |
|
|
import { Reflector } from '@nestjs/core'; |
|
|
import { Reflector } from '@nestjs/core'; |
|
|
import { StatusCodes, getReasonPhrase } from 'http-status-codes'; |
|
|
import { StatusCodes, getReasonPhrase } from 'http-status-codes'; |
|
|
|
|
|
|
|
|
// Denies modifying requests while an impersonation is active, so that data of
|
|
|
/** |
|
|
// the authenticated user cannot be changed from a view presenting data of the
|
|
|
* Blocks write requests while an impersonation is active, so that data of the |
|
|
// impersonated user. The header is evaluated instead of the resolved context to
|
|
|
* authenticated user cannot be changed from a view presenting data of the |
|
|
// fail closed, also for an identifier which cannot be resolved.
|
|
|
* impersonated user. The header is evaluated instead of the resolved context to |
|
|
|
|
|
* fail closed, also for an identifier which cannot be resolved. |
|
|
|
|
|
*/ |
|
|
@Injectable() |
|
|
@Injectable() |
|
|
export class ImpersonationWriteGuard implements CanActivate { |
|
|
export class ImpersonationWriteGuard implements CanActivate { |
|
|
public constructor(private readonly reflector: Reflector) {} |
|
|
public constructor(private readonly reflector: Reflector) {} |
|
|
|