Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 647 Bytes

ARC0019.md

File metadata and controls

27 lines (19 loc) · 647 Bytes
title ARC0019: Contradictory authorization
description Fix ARC0019 in Arc TypeScript by removing contradictory anonymous access and role or authorization decorators from the same class or method.

What

A class or method has both @allowAnonymous() and @roles() or @authorize(). Rule: arc-core/arc0019.

Why

Arc rejects conflicting authorization. A class-level restriction overridden by a method-level anonymous declaration is a different, supported case.

Bad

@allowAnonymous()
@roles('Admin')
export class Register { handle() {} }

Good

@roles('Admin')
export class Register { handle() {} }