forest-cli
Version:
The Lumberjacks' toolbelt is the Forest CLI which makes easy to manage your back office application directly from the terminal.
59 lines • 1.96 kB
TypeScript
export = RoleManager;
/**
* Read/write access to a project's roles.
* PRD-528/535: extended with write operations for `forest roles:*` commands.
* @param {{ projectId: number | string }} config
*/
declare function RoleManager(config: {
projectId: number | string;
}): void;
declare class RoleManager {
/**
* Read/write access to a project's roles.
* PRD-528/535: extended with write operations for `forest roles:*` commands.
* @param {{ projectId: number | string }} config
*/
constructor(config: {
projectId: number | string;
});
listForProject: () => Promise<any>;
/**
* Fetch a single role with its full permissions object.
* @param {string|number} roleId
* @returns {Promise<{ id: string, name: string, permissions: object }>}
*/
getRoleById: (roleId: string | number) => Promise<{
id: string;
name: string;
permissions: object;
}>;
/**
* Create a new role in the project.
* @param {string} name
* @param {string|number} projectId
* @returns {Promise<{ id: string, name: string }>}
*/
createRole: (name: string, projectId: string | number) => Promise<{
id: string;
name: string;
}>;
/**
* Apply RFC-6902 JSON Patch ops to a role's permissions.
* @param {string|number} roleId
* @param {Array<{ op: string, path: string, value: unknown }>} ops
* @returns {Promise<void>}
*/
patchPermissions: (roleId: string | number, ops: {
op: string;
path: string;
value: unknown;
}[]) => Promise<void>;
/**
* Copy all permissions from one environment to another within the project.
* @param {string|number} fromEnvId
* @param {string|number} toEnvId
* @returns {Promise<void>}
*/
copyPermissions: (fromEnvId: string | number, toEnvId: string | number) => Promise<void>;
}
//# sourceMappingURL=role-manager.d.ts.map