express-rest-decorators - v1.0.0-rc.2
    Preparing search index...

    Function Authorized

    • Restricts access to the decorated class or method. @Authorized() — any authenticated user (authorized === null) @Authorized('admin') — must have 'admin' role @Authorized(['a', 'b']) — must have 'a' or 'b' role Last-write-wins on the same target.

      Returns ClassDecorator & MethodDecorator

    • Restricts access to the decorated class or method. @Authorized() — any authenticated user (authorized === null) @Authorized('admin') — must have 'admin' role @Authorized(['a', 'b']) — must have 'a' or 'b' role Last-write-wins on the same target.

      Parameters

      • role: string

      Returns ClassDecorator & MethodDecorator

    • Restricts access to the decorated class or method. @Authorized() — any authenticated user (authorized === null) @Authorized('admin') — must have 'admin' role @Authorized(['a', 'b']) — must have 'a' or 'b' role Last-write-wins on the same target.

      Parameters

      • roles: string[]

      Returns ClassDecorator & MethodDecorator