Skip to content

frontend-web-editor


Function: UpdateAbility()

UpdateAbility(ability, roles): Promise<void>

Defined in: app/casl/ability.ts:33

Updates the existing ability with new roles.

Parameters

ability

AppAbility

The current AppAbility instance that needs to be updated.

roles

string[]

An array of role names (strings) that will be used to fetch the updated permissions.

Returns

Promise<void>

A promise that resolves when the ability has been updated.

This function fetches the latest roles from the API using GetAllRoles, extracts the permissions, and updates the provided AppAbility instance with the new rules.