This commit is contained in:
Sebastian Seedorf
2020-11-16 10:01:58 +01:00
parent 7fbc95f86a
commit 2629d1e8e9
55 changed files with 4904 additions and 0 deletions

24
out/permissions.d.ts vendored Normal file
View File

@@ -0,0 +1,24 @@
import { AccessControl, IQueryInfo, Permission } from 'role-acl';
import { Query } from 'role-acl/lib/src/core/Query';
import { Request, RequestHandler } from 'express';
declare class PermissionManager extends AccessControl {
can(roleOrRequest: Request | string | string[] | IQueryInfo): PermQuery;
getRouter(resource: string, opts: Partial<RermRouterOpts>): RequestHandler;
}
export declare type RermRouterOpts = {
context: unknown;
action: string;
skipConditions: boolean;
};
export declare class PermQuery extends Query {
protected resolveRequest: Request | undefined;
constructor(grants: unknown, roleOrRequest: Request | string | string[] | IQueryInfo);
on(resource: string, skipConditions?: boolean): Promise<Permission>;
context(context: unknown): PermQuery;
skipConditions(value: boolean): PermQuery;
with(context: unknown): PermQuery;
execute(action: string): PermQuery;
sync(): PermQuery;
}
export declare const Permissions: PermissionManager;
export {};