A role is an access control resource that can be assigned to organization memberships, directory users, and SSO profiles.
const role = { object: 'role', id: 'role_01EHZNVPK3SFK441A1RGBFSHRT', name: 'Member', slug: 'member', description: 'Access to basic resources', permissions: ['posts:read', 'posts:write'], type: 'EnvironmentRole', createdAt: '2021-06-25T19:07:33.155Z', updatedAt: '2021-06-25T19:07:33.155Z', };
interface RoleGet a list of all roles for the provided organization in priority order. Includes all environment and organization roles.
import { WorkOS } from '@workos-inc/node'; const workos = new WorkOS('sk_example_123456789'); const roles = await workos.organizations.listOrganizationRoles({ organizationId: 'org_01EHZNVPK3SFK441A1RGBFSHRT', }); console.log(roles.data);
organizations .listOrganizationRoles()Returns object