File tree Expand file tree Collapse file tree 2 files changed +8
-11
lines changed
Expand file tree Collapse file tree 2 files changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,6 @@ typings/
6161api-docs /
6262
6363# Transpiled JavaScript files from Typescript
64- / dist
64+ dist /
6565
6666* .tsbuildinfo
Original file line number Diff line number Diff line change @@ -24,25 +24,22 @@ export class AuthorizeActionProvider implements Provider<AuthorizeFn> {
2424
2525 async action ( userPermissions : string [ ] , request ?: Request ) : Promise < boolean > {
2626 const metadata : AuthorizationMetadata = await this . getMetadata ( ) ;
27- let methodName = '' ;
28- try {
29- // eslint-disable-next-line @typescript-eslint/no-unused-vars
30- methodName = await this . requestContext . get (
31- CoreBindings . CONTROLLER_METHOD_NAME ,
32- ) ;
33- } catch ( error ) {
34- throw new HttpErrors . NotFound ( 'API not found !' ) ;
35- }
3627
3728 if ( request && this . checkIfAllowedAlways ( request ) ) {
3829 return true ;
3930 } else if ( ! metadata ) {
40- return false ;
31+ try {
32+ await this . requestContext . get ( CoreBindings . CONTROLLER_METHOD_NAME ) ;
33+ return false ;
34+ } catch ( error ) {
35+ throw new HttpErrors . NotFound ( 'API not found !' ) ;
36+ }
4137 } else if ( metadata . permissions . indexOf ( '*' ) === 0 ) {
4238 // Return immediately with true, if allowed to all
4339 // This is for publicly open routes only
4440 return true ;
4541 }
42+
4643 const permissionsToCheck = metadata . permissions ;
4744 return intersection ( userPermissions , permissionsToCheck ) . length > 0 ;
4845 }
You can’t perform that action at this time.
0 commit comments