@rnaga/wp-node
Version:
👉 **[View Full Documentation at rnaga.github.io/wp-node →](https://rnaga.github.io/wp-node/)**
21 lines • 850 B
TypeScript
import { Components } from "./components";
import { User } from "./user";
import type * as types from "../types";
import { Config } from "../config";
export declare class Role {
private components;
private config;
readonly primaryName: types.RoleNames;
names: Set<string>;
capabilities: Set<string>;
constructor(components: Components, config: Config, primaryName?: types.RoleNames, capabilities?: string[]);
addNames(names: string[]): void;
isSuperAdmin(): boolean;
isAdmin(): boolean;
is<T>(roleName: T): boolean;
add(capabilities: string[]): void;
has<T>(cap: T): boolean;
can<T extends types.RoleCapabilityActions>(action: T, user: number | User, ...args: any): Promise<boolean>;
can(action: string, user: number | User, ...args: any): Promise<boolean>;
}
//# sourceMappingURL=role.d.ts.map