Load available capabilities
Render or enable features based on the user's complete access set.
Kinde · Function
getPermissions asynchronously returns all permissions for the current user in the organization they are signed in to. The result includes the organization code and an array of permission keys.
Call getPermissions to asynchronously obtain every permission assigned to the current user within the organization they are signed into. The returned object identifies that organization with orgCode and provides the permission keys in a permissions array.
kinde.getPermissions();A Promise resolving to an object containing orgCode and permissions, where permissions is an array of permission keys.
const { getPermissions } = useKindeAuth();
const runAsyncFunction = async () => {
const permissions = await getPermissions();
console.log(permissions);
};
runAsyncFunction();Asynchronously retrieves the signed-in user's permissions and logs the organization code and permission keys.
Render or enable features based on the user's complete access set.
Associate authorization data with the organization currently selected by the user.
Inspect several permissions at once before constructing an access-aware view.
getPermissions returns all permissions for the current user in their signed-in organization. In the JavaScript SDK, the result contains orgCode and a permissions array.
Follow-up: How would you check one permission? Use getPermission with the permission key and inspect its isGranted value.
The call takes no arguments and is used as kinde.getPermissions(). The documented result includes the organization code and permission keys such as create:todos or read:todos.
Follow-up: How can permissions be made available to the application? Configure the permissions in Kinde and ensure the application reads the access token data.
Permissions are organization-scoped: the function reports permissions for the organization in which the user is currently signed in. The response separates that organization identifier from the permissions list.
Follow-up: What should code do when it needs a single authorization decision? Call getPermission for the relevant key rather than scanning the complete list.
getPermissionuseKindeAuthpermissionsorgCode