permission-react: keep batching internal
Revert the public multi-request authorize overload and rely on internal batching instead. Frontend app predicate checks now make separate authorize calls that still coalesce within the same tick. Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com> Made-with: Cursor
This commit is contained in:
@@ -62,14 +62,8 @@ export class IdentityPermissionApi implements PermissionApi {
|
||||
request: AuthorizePermissionRequest,
|
||||
): Promise<AuthorizePermissionResponse>;
|
||||
async authorize(
|
||||
requests: AuthorizePermissionRequest[],
|
||||
): Promise<AuthorizePermissionResponse[]>;
|
||||
async authorize(
|
||||
request: AuthorizePermissionRequest | AuthorizePermissionRequest[],
|
||||
): Promise<AuthorizePermissionResponse | AuthorizePermissionResponse[]> {
|
||||
if (Array.isArray(request)) {
|
||||
return Promise.all(request.map(r => this.loader.load(r)));
|
||||
}
|
||||
request: AuthorizePermissionRequest,
|
||||
): Promise<AuthorizePermissionResponse> {
|
||||
return this.loader.load(request);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,9 +30,6 @@ export type PermissionApi = {
|
||||
authorize(
|
||||
request: EvaluatePermissionRequest,
|
||||
): Promise<EvaluatePermissionResponse>;
|
||||
authorize(
|
||||
requests: EvaluatePermissionRequest[],
|
||||
): Promise<EvaluatePermissionResponse[]>;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user