Files
main.tsmain
What you'll learn
- Tell ArgumentsHost from ExecutionContext, and know what getType(), getArgs(), getHandler() and getClass() give
- Write a metadata decorator with SetMetadata and read it with the Reflector by key, next to one made with Reflector.createDecorator
- Merge class-level and handler-level metadata with getAllAndOverride, and register a global guard under APP_GUARD
Press Run tests to start the app. Its log appears here.Graded endpoints
The class requires reader, the handler says public, and the handler wins: getAllAndOverride read the handler first
Neither the handler nor the class requires anything, so the global guard lets it through
The handler has no roles of its own, so the class's reader applies, and there is no user
bob is a reader, which the class requires
The handler overrides the class with admin; bob is not one
An admin
Class default again: reader
Overridden to admin
An admin may