GhaylStackDocumentationv1.0.2
العربيةWebsite
Platform modules

Platform modules

Identity, users and roles

Create users, assign roles and diagnose permission failures in the active tenant.

What this module owns

Identity manages user accounts, roles, permission assignments, groups, sessions, two-factor authentication and operator impersonation. Its API is grouped under /api/v1/identity. Start with a running environment from Quick start, then sign in to the tenant whose accounts you intend to administer.

A tenant is an isolated workspace. A group collects users inside that workspace; an organizational unit describes a department or branch. These concepts have separate records and checks. Creating a group does not substitute for an organizational scope grant.

Create an account and give it a useful role

  1. Open the users area in the relevant web application and create a development user. Administrative creation uses POST /api/v1/identity/register and requires Permissions.Users.Create.
  2. Create or select a role. Role creation uses POST /api/v1/identity/roles; its endpoint requires Permissions.Roles.Create.
  3. Load the registered permission catalog using GET /api/v1/identity/permissions/catalog. The catalog is filtered for the caller's root or tenant context.
  4. Assign the permissions needed for the job to the role, then assign the role through POST /api/v1/identity/users/{id}/roles. Role assignment requires Permissions.Users.ManageRoles.
  5. Sign in as the new user in a separate browser profile and verify both an allowed action and a prohibited action.

Read the DTO and handler linked below before creating an API integration. The permission update route is /api/v1/identity/{id}/permissions; do not infer its shape from the role listing route.

Choose permissions by responsibility

Responsibility Permission examples
Read accounts Permissions.Users.View
Change role membership Permissions.Users.ManageRoles
Read and edit role permissions Permissions.Roles.View, Permissions.Roles.Update
Organize group membership Permissions.Groups.ManageMembers
Inspect all sessions Permissions.Sessions.ViewAll
Revoke another user's sessions Permissions.Sessions.RevokeAll

An endpoint permission answers whether a user may perform an action. Modules such as Workflows and Organizations additionally check whether that user can act on the selected organizational unit. A successful sign-in therefore does not establish access to every record. See Authorization.

Account lifecycle and sessions

Identity exposes email confirmation, password reset and password change flows, alongside activation and deletion operations. Authentication endpoints have an auth rate limiter. Keep self-registration and administrative registration distinct when designing your application.

Use GET /api/v1/identity/sessions/me to review the current user's sessions. Tenant-wide session inspection and revocation have separate permissions. TOTP enrollment, verification and disabling live under /api/v1/identity/2fa/. Impersonation also has explicit start, end, history and revoke routes; do not implement it by sharing an administrator's credentials.

Verify and troubleshoot

For a 403, inspect the active tenant, the user's enabled roles, the exact permission required by the endpoint, and any organizational scope required by its handler. Hiding a button in the browser does not authorize the server request.

Verify account activation, confirmation and role changes with a second user session. When a group appears empty, check membership in that same tenant before adding duplicate accounts. When extending Identity, retain tenant checks and use its Contracts services from other modules rather than querying its tables directly.

Implementation references

View MarkdownBack to top

Search documentation

Use ↑ ↓ to move, Enter to open and Esc to close.