Explore Library
Quiz

Reflector metadata resolution in guards

Understanding why getAllAndOverride matters when reading custom metadata at both handler and controller level.

You have a @Roles() decorator built with SetMetadata('roles', ...). It is applied at the controller class level, but one specific handler method also has its own @Roles() that should take precedence. Inside your RolesGuard, which Reflector call correctly reads the metadata so the handler-level value overrides the controller-level one?