authz: fix PermissionCondition type parameter
The type parameter for PermissionCondition refers to the type of the condition params, not the type of the leaf entries in a PermissionCriteria object. It should be safe to always set this type parameter to `unknown[]` in this case. Each PermissionCondition is will have different parameters, therefore we just need to enforce that the params is always an array of unknown. Signed-off-by: Mike Lewis <mtlewis@users.noreply.github.com>
This commit is contained in:
@@ -86,5 +86,5 @@ export type PermissionCriteria<TQuery> =
|
||||
| {
|
||||
not: PermissionCriteria<TQuery>;
|
||||
}
|
||||
| PermissionCondition<TQuery>;
|
||||
| PermissionCondition<unknown[]>;
|
||||
```
|
||||
|
||||
@@ -67,7 +67,7 @@ export type PermissionCriteria<TQuery> =
|
||||
| { allOf: PermissionCriteria<TQuery>[] }
|
||||
| { anyOf: PermissionCriteria<TQuery>[] }
|
||||
| { not: PermissionCriteria<TQuery> }
|
||||
| PermissionCondition<TQuery>;
|
||||
| PermissionCondition<unknown[]>;
|
||||
|
||||
/**
|
||||
* An authorization response from {@link PermissionClient#authorize}.
|
||||
|
||||
Reference in New Issue
Block a user