Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Kinde · Module

getPermission

Checks whether the current user has a specified permission in the active organization. It returns the permission key, organization code, and a boolean access result.

How it works

In Kinde's React SDK, obtain getPermission from useKindeAuth and pass it a permission key such as read:todos. The asynchronous call evaluates the current user's permission for their active organization and returns an object containing the key, organization code, and whether access is granted.

Syntax

const { getPermission } = useKindeAuth();
await getPermission(permissionKey);

Parameters

NameTypeDescription
permissionKeystringPermission key to check, such as read:todos.

Returns

A promise resolving to an object containing permissionKey, orgCode, and isGranted.

Key points

  • Use getPermission to evaluate one named permission rather than retrieve the full permission list.
  • In React, access the helper by destructuring it from useKindeAuth.
  • The method accepts a permission key, represented as a string such as create:todos.
  • The result identifies the checked key, active organization, and whether the permission is granted.
  • Use the related getPermissions helper when the application needs the complete active-organization list.

Common mistakes

  • Configure the application to read permissions before relying on this helper.
  • The permission data becomes available after the user is verified as signed in.

Example: Check a permission

const { getPermission } = useKindeAuth();

const runAsyncFunction = async () => {
  const permission = await getPermission("read:todos");
  console.log(permission);
};

<button onClick={runAsyncFunction}>Get Permission</button>;

Checks the signed-in user's access to the specified permission and returns its state.

When to use it

Gate a user action

A todo application needs to decide whether to show its create or edit control.

Protect application UI

A frontend route should display content only to users with a required permission.

Inspect organization context

An organization-aware interface needs to report the permission context used for a decision.

Interview questions

QWhat does getPermission do and what does it return?

getPermission checks one permission for the current user. In the React SDK it is called through useKindeAuth and resolves to an object with permissionKey, orgCode, and isGranted.

Follow-up: How would you inspect every permission instead? Use getPermissions, which returns the current organization's permission collection.

QHow is getPermission called in the React SDK?

Pass the permission key as a string, for example read:todos. The call is asynchronous, so await its result before using the returned access state.

Follow-up: What should the UI do with isGranted? Use it to conditionally enable or render the protected action.

QWhy does the result include an organization code?

Permission values are tied to the organization the user is signed into. The result includes orgCode so the organization context can be identified.

Follow-up: Why does organization context matter? A user can have different permissions in different organizations, so checks must use the active organization.

  • useKindeAuth
  • getPermissions
  • ProtectedRoute
  • has

Source: React SDK - Kinde docs. Checked 2026-10-15.