Skip to content

Using context as you would in Guards/Interceptors #70

@josefmic

Description

@josefmic

Hi,
from what I understand, there isn't an implementation for using Guards and Interceptors, which I am missing. I want to create a custom decorator like this:

@Router({ alias: 'reboot' })
@Roles([Role.FULL_ACCESS])
export class RebootBrowseRouter {
    constructor(private readonly rebootBrowseService: RebootBrowseService) {}

    @Query({
        input: rebootBrowseParamsSchema,
        output: rebootBrowseResponseSchema
    })
    async getList(@Input() params: RebootBrowseParams) {
        return this.rebootBrowseService.getRebootServers(params);
    }
}

But my issue is that middlewars don't have access to the decorator data (maybe I am wrong?). Is there any one of you who figured out how to do it?

Either by using global middleware/guard/interceptor or by using them in the @Roles decorator?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions