inital #2
This commit is contained in:
24
out/permissions.d.ts
vendored
Normal file
24
out/permissions.d.ts
vendored
Normal 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 {};
|
||||
Reference in New Issue
Block a user