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:
Mike Lewis
2021-11-11 13:28:25 +00:00
parent 59702b2bde
commit 00448f02e6
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -86,5 +86,5 @@ export type PermissionCriteria<TQuery> =
| {
not: PermissionCriteria<TQuery>;
}
| PermissionCondition<TQuery>;
| PermissionCondition<unknown[]>;
```
+1 -1
View File
@@ -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}.