set is_api_token to context correctly also fix the typescript definition of nccontext

This commit is contained in:
Fendy Heryanto
2026-01-28 10:02:57 +00:00
parent 0a2fe65dc0
commit 1c6650e85c
2 changed files with 8 additions and 0 deletions

View File

@@ -19,6 +19,10 @@ export interface NcContext {
suppressDependencyEvaluation?: boolean;
additionalContext?: Record<string, any>;
schema_locked?: boolean;
cache?: boolean;
cacheMap?: any;
permissions?: any;
is_api_token?: boolean;
}
export interface NcRequest extends Partial<Request> {

View File

@@ -1113,6 +1113,10 @@ export class AclMiddleware implements NestInterceptor {
NcError.sourceDataReadOnly(source.alias);
}
}
if (req.context) {
req.context.is_api_token = req.user.is_api_token;
}
}
async intercept(