@loopback/authorization
Version:
A LoopBack component for authorization support.
15 lines (14 loc) • 606 B
TypeScript
import { Principal, UserProfile } from '@loopback/security';
/**
* Module `@loopback/authentication` passes a user profile to
* `@loopback/authorization` as the user identity. Authorization verifies
* whether a user has access to a certain resource.
*
* The builder function:
* - preserves all the fields from user profile
* - specifies 'USER' as type
* - assign the value of `securityId` to name if it's missing in the
* user profile
* @param user The user profile passed from `@loopback/authentication`.
*/
export declare function createPrincipalFromUserProfile(user: UserProfile): Principal;