nralcm
Version:
This is a framework based on NodeJs to manage rest api request lifecycle
24 lines (23 loc) • 543 B
TypeScript
/**
* AuthPrinciple class
*/
export declare abstract class AuthPrinciple {
/**
* userId of User
* userId can be email or GUID
*/
userId: string;
/**
* Roles of User
*/
roles: string[];
private _isAuthenticated;
constructor(userId: string, roles: string[]);
/**
* abstract method to implement. Check for authorization of user
* based on roles
* @param roles Roles of User
*/
abstract isAuthorized(roles: string[]): boolean;
readonly isAuthenticated: boolean;
}