- securityPolicy<Permission, T, SecurityDomainKeys, SecurityContextPermission, SecurityDomain>(input: {
defaultPermission?: CRUDPermission<T>;
domainMap?: { [ K in string | number | symbol]?: null | keyof T["model"] | {
or: (keyof T["model"])[];
} | {
and: (keyof T["model"])[];
} };
permissions: Permissions<T, Permission>;
securityContext: ((metadata: T["metadata"]) => SecurityContext<Permission, SecurityContextPermission>);
securityDomains: ((metadata: undefined | T["operationMetadata"]) => undefined | SecurityDomain[]);
securityDomainsInjector?: ((securityDomains: SecurityDomain[], metadata: undefined | T["operationMetadata"]) => undefined | T["operationMetadata"]);
}): DAOMiddleware<T>
-
Type Parameters
-
Permission extends string
-
T extends DAOGenerics<any, any, any, any, any, any, any, any, any, any, any, any, any, AbstractEntityManager<string, string, any, any>, T>
-
SecurityDomainKeys extends string
-
SecurityContextPermission extends { [ K in string]?: true | T["plainModel"][K] }
-
SecurityDomain extends { [ K in string]?: T["plainModel"][K][] }
Parameters
-
input: {
defaultPermission?: CRUDPermission<T>;
domainMap?: { [ K in string | number | symbol]?: null | keyof T["model"] | {
or: (keyof T["model"])[];
} | {
and: (keyof T["model"])[];
} };
permissions: Permissions<T, Permission>;
securityContext: ((metadata: T["metadata"]) => SecurityContext<Permission, SecurityContextPermission>);
securityDomains: ((metadata: undefined | T["operationMetadata"]) => undefined | SecurityDomain[]);
securityDomainsInjector?: ((securityDomains: SecurityDomain[], metadata: undefined | T["operationMetadata"]) => undefined | T["operationMetadata"]);
}
-
Optional
defaultPermission?: CRUDPermission<T>
-
Optional
domainMap?: { [ K in string | number | symbol]?: null | keyof T["model"] | {
or: (keyof T["model"])[];
} | {
and: (keyof T["model"])[];
} }
-
permissions: Permissions<T, Permission>
-
securityContext: ((metadata: T["metadata"]) => SecurityContext<Permission, SecurityContextPermission>)
-
- (metadata: T["metadata"]): SecurityContext<Permission, SecurityContextPermission>
-
Returns SecurityContext<Permission, SecurityContextPermission>
-
securityDomains: ((metadata: undefined | T["operationMetadata"]) => undefined | SecurityDomain[])
-
- (metadata: undefined | T["operationMetadata"]): undefined | SecurityDomain[]
-
Parameters
-
metadata: undefined | T["operationMetadata"]
Returns undefined | SecurityDomain[]
-
Optional
securityDomainsInjector?: ((securityDomains: SecurityDomain[], metadata: undefined | T["operationMetadata"]) => undefined | T["operationMetadata"])
-
- (securityDomains: SecurityDomain[], metadata: undefined | T["operationMetadata"]): undefined | T["operationMetadata"]
-
Parameters
-
securityDomains: SecurityDomain[]
-
metadata: undefined | T["operationMetadata"]
Returns undefined | T["operationMetadata"]