@linode/api-v4
Version:
JavaScript wrapper around the Linode APIv4
64 lines • 2.27 kB
TypeScript
import type { Filter, Params, ResourcePage } from '../types';
import type { AccessType, EntityByPermission, IamAccountRoles, IamUserRoles, PermissionType } from './types';
import type { EntityType } from 'src/entities/types';
/**
* getUserRoles
*
* Returns the full permissions structure for this User. This includes all entities on
* the Account alongside what level of access this User has to each of them.
*
* @param username { string } the username to look up.
*
*/
export declare const getUserRoles: (username: string) => Promise<IamUserRoles>;
/**
* updateUserRoles
*
* Update the roles a User has.
*
* @param username { string } username of the user to be updated.
* @param data { object } the Roles object to update.
*
*/
export declare const updateUserRoles: (username: string, data: IamUserRoles) => Promise<IamUserRoles>;
/**
* getAccountRoles
*
* Return all roles for account.
*
*/
export declare const getAccountRoles: () => Promise<IamAccountRoles>;
/**
* getUserAccountPermissions
*
* Returns the current permissions for this User on the account.
*
* @param username { string } the username to look up.
*
*/
export declare const getUserAccountPermissions: (username: string) => Promise<import("./types").AccountAdmin[]>;
/**
* getUserEntityPermissions
*
* Returns the current permissions for this User on the entity.
*
* @param username { string } the username to look up.
* @param entityType { AccessType } the entityType to look up.
* @param entityId { number } the entityId to look up.
*/
export declare const getUserEntityPermissions: (username: string, entityType: AccessType, entityId: number | string, params?: Params, filter?: Filter) => Promise<import("./types").AccountAdmin[]>;
/**
* getUserEntitiesByPermission
*
* Returns the available entities for a given permission.
*/
export interface GetEntitiesByPermissionParams {
enabled?: boolean;
entityType: EntityType;
filter?: Filter;
params?: Params;
permission: PermissionType;
username: string | undefined;
}
export declare const getUserEntitiesByPermission: ({ username, entityType, permission, params, filter, }: GetEntitiesByPermissionParams) => Promise<ResourcePage<EntityByPermission>>;
//# sourceMappingURL=iam.d.ts.map