routing-controllers
Version:
Create structured, declarative and beautifully organized class-based controllers with heavy decorators usage for Express / Koa using TypeScript.
19 lines • 648 B
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.Authorized = Authorized;
const index_1 = require("../index");
/**
* Marks controller action to have a special access.
* Authorization logic must be defined in routing-controllers settings.
*/
function Authorized(roleOrRoles) {
return function (clsOrObject, method) {
(0, index_1.getMetadataArgsStorage)().responseHandlers.push({
type: 'authorized',
target: method ? clsOrObject.constructor : clsOrObject,
method: method,
value: roleOrRoles,
});
};
}
//# sourceMappingURL=Authorized.js.map
;