pos-be/src/core/guards/domain/roles.guard.ts

24 lines
611 B
TypeScript

import { Injectable, ExecutionContext } from '@nestjs/common';
import { Observable } from 'rxjs';
import { JWTGuard } from './jwt.guard';
@Injectable()
export class RolesGuard extends JWTGuard {
canActivate(
context: ExecutionContext,
): boolean | Promise<boolean> | Observable<boolean> {
super.canActivate(context);
/**
* Create function to check if `this.userSession` have access
* to Read / Create / Update / and Other Action
*/
/**
* Assign rules to session, So Query can take the rules and give
* the data base on user request
*/
return true;
}
}