@@ -179,8 +179,8 @@ export const catalogConditions: Conditions<{
|
||||
EntitiesSearchFilter,
|
||||
'catalog-entity',
|
||||
{
|
||||
value?: string | undefined;
|
||||
annotation: string;
|
||||
value: string | undefined;
|
||||
}
|
||||
>;
|
||||
hasLabel: PermissionRule<
|
||||
@@ -196,8 +196,8 @@ export const catalogConditions: Conditions<{
|
||||
EntitiesSearchFilter,
|
||||
'catalog-entity',
|
||||
{
|
||||
value?: string | undefined;
|
||||
key: string;
|
||||
value: string | undefined;
|
||||
}
|
||||
>;
|
||||
hasSpec: PermissionRule<
|
||||
@@ -205,8 +205,8 @@ export const catalogConditions: Conditions<{
|
||||
EntitiesSearchFilter,
|
||||
'catalog-entity',
|
||||
{
|
||||
value?: string | undefined;
|
||||
key: string;
|
||||
value: string | undefined;
|
||||
}
|
||||
>;
|
||||
isEntityKind: PermissionRule<
|
||||
@@ -468,8 +468,8 @@ export const permissionRules: {
|
||||
EntitiesSearchFilter,
|
||||
'catalog-entity',
|
||||
{
|
||||
value?: string | undefined;
|
||||
annotation: string;
|
||||
value: string | undefined;
|
||||
}
|
||||
>;
|
||||
hasLabel: PermissionRule<
|
||||
@@ -485,8 +485,8 @@ export const permissionRules: {
|
||||
EntitiesSearchFilter,
|
||||
'catalog-entity',
|
||||
{
|
||||
value?: string | undefined;
|
||||
key: string;
|
||||
value: string | undefined;
|
||||
}
|
||||
>;
|
||||
hasSpec: PermissionRule<
|
||||
@@ -494,8 +494,8 @@ export const permissionRules: {
|
||||
EntitiesSearchFilter,
|
||||
'catalog-entity',
|
||||
{
|
||||
value?: string | undefined;
|
||||
key: string;
|
||||
value: string | undefined;
|
||||
}
|
||||
>;
|
||||
isEntityKind: PermissionRule<
|
||||
|
||||
@@ -179,23 +179,11 @@ export type PermissionRule<
|
||||
name: string;
|
||||
description: string;
|
||||
resourceType: TResourceType;
|
||||
paramsSchema?: PermissionRuleSchema<TParams>;
|
||||
apply(
|
||||
resource: TResource,
|
||||
params: NoInfer<z.input<PermissionRuleSchema<TParams>>>,
|
||||
): boolean;
|
||||
toQuery(
|
||||
params: NoInfer<z.input<PermissionRuleSchema<TParams>>>,
|
||||
): PermissionCriteria<TQuery>;
|
||||
paramsSchema?: z.ZodSchema<TParams>;
|
||||
apply(resource: TResource, params: NoInfer<TParams>): boolean;
|
||||
toQuery(params: NoInfer<TParams>): PermissionCriteria<TQuery>;
|
||||
};
|
||||
|
||||
// @public
|
||||
export type PermissionRuleSchema<TParams> = z.ZodObject<{
|
||||
[P in keyof TParams]-?: TParams[P] extends undefined
|
||||
? z.ZodOptionalType<z.ZodType<TParams[P]>>
|
||||
: z.ZodType<TParams[P]>;
|
||||
}>;
|
||||
|
||||
// @public
|
||||
export type PolicyQuery = {
|
||||
permission: Permission;
|
||||
|
||||
Reference in New Issue
Block a user