Skip to main content
Version: 2.0.0

permit.api.roles.get()

Fetch the role and the role information.

Parameters

roleKey - The key of the role. This is the unique identifier of the role.

Implementation

import io.permit.sdk.openapi.models.RoleRead;

// accepts both the role id and the role key
RoleRead role = permit.api.roles.get("[ROLE ID OR KEY]");

// if you want to be explicit, you can use getByKey
RoleRead role2 = permit.api.roles.getByKey("[ROLE KEY]");

// or getById
RoleRead role3 = permit.api.roles.getById(new UUID("[ROLE ID]"));