export declare type RolesObj = { [key: string]: string[]; }; /** * A class that represents both authentication and authorisation. Meaning that it * both serves to identify what is performing an action, and what permissions it has. */ export declare class Auth { extraRoles: RolesObj; roles: string[]; id: string; type: string; /** * Construct an Auth object * @param {string} type The type of entity that this Auth represents. e.g. 'user', 'cron', etc * @param {string} id The identification of the entity. e.g. In the case of a user, this is the user id * @param {string[]} roles A list of the roles that this entity has * @param {object} extraRoles A list of extra roles that this Auth provides for a specific entity. e.g. * {":": ["role1", "role2"], "module:": [ "role3", "role4"] } */ constructor(type: string, id: string, roles?: Array, extraRoles?: RolesObj); getType(): string; getId(): string; getFullId(): string; /** * Returns the roles of this entity. In the case that an entity is provided, it will also * include any extra roles that it may have re: that entity. * @param {[string]} forEntity An optional entity that we want to check roles for */ getRoles(forEntity?: string): Array; getExtraRoles(): RolesObj; }