Skip to content

Commit

Permalink
Small grammar and visual changes
Browse files Browse the repository at this point in the history
  • Loading branch information
filipermit committed Feb 10, 2025
1 parent 179a38a commit 0fd69a6
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions docs/overview/sync-your-first-user-with-sdk.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,27 @@ title: Sync your First User

Syncing users is one of the most integral parts of using Permit, as it serves as the handoff point
between your application's user management system (usually Authentication or IdP) and the Permit authorizaiton control-plane.
Note: Users are the name we use fort both human and machine identities.

:::note NOTE
**`Users`** are the **name** we use for both **human** and **machine identities**.
:::

import CodeBlock from "../../src/components/code-block/CodeBlock";
import WhatsNext from "../../src/components/whats-next/WhatsNext";
import TimelineStep from "../../src/components/timeline/TimelineStep";
import TimelineWrapper from "../../src/components/timeline/TimelineWrapper";

## TL;DR
Sync users on-the-fly by passing their unique ID to the craeteUser API or create/sync-User SDK call.
This should be done as part of your Authentication callback
- Newly added users would appear in the Direcoty under `All Tenants`.
- Assign roles to users to also link them to specific tenants.
- You can assign multipe users to multiple roles at multiple tenants
- You can use the bulk API to load mutliple users at once.

Sync users on-the-fly by passing their unique ID to the `createUser` API or `users.create/sync` SDK call.
This should be done as part of your Authentication callback.

1. Newly added users would appear in the Directory under `All Tenants`.
2. Assign roles to users to also link them to specific tenants.
3. You can assign multiple users to multiple roles at multiple tenants.
4. You can use the bulk API to load multiple users at once.

> In this guide, we’ll show you how to sync your first user into Permit using the API, ensuring they’re already assigned a role,
> or ready to be assigned roles and permissions within your access control model.
---

## When to sync your users?

Expand All @@ -33,7 +35,10 @@ attributes, and relationships. This ensures their permissions align immediately

## Our API Reference

In this guide we will be making use of two separate endpoint in our API:
In this walkthrough, we’ll show you how to sync your first user into Permit using the API, ensuring they’re already assigned a
role, or ready to be assigned roles and permissions within your access control model.

We will be making use of two separate endpoint in our API:

1. [Creating a user](https://api.permit.io/scalar#tag/users/POST/v2/facts/{proj_id}/{env_id}/users)
2. [Assigning a role to a user](https://api.permit.io/scalar#tag/users/POST/v2/facts/{proj_id}/{env_id}/users/{user_id}/roles)
Expand Down Expand Up @@ -167,15 +172,15 @@ are customized for that tenant.
</TimelineStep>
</TimelineWrapper>


## Bulk user syncing

Our API also supports syncing and updating users en-masse.
See:
1. [Bulk `Create` User](https://api.permit.io/scalar#tag/bulk-operations/POST/v2/facts/{proj_id}/{env_id}/bulk/users)
2. [Bulk `Replace` User](https://api.permit.io/scalar#tag/bulk-operations/PUT/v2/facts/{proj_id}/{env_id}/bulk/users)
3. [Bulk `Assign Roles` to Users](https://api.permit.io/scalar#tag/bulk-operations/POST/v2/facts/{proj_id}/{env_id}/role_assignments/bulk)
4. [Bulk `Unassign Roles` to Users](https://api.permit.io/scalar#tag/bulk-operations/DELETE/v2/facts/{proj_id}/{env_id}/role_assignments/bulk)
5. [Bulk `Delete` User](https://api.permit.io/scalar#tag/bulk-operations/DELETE/v2/facts/{proj_id}/{env_id}/bulk/users)

- [Bulk `Create` User](https://api.permit.io/scalar#tag/bulk-operations/POST/v2/facts/{proj_id}/{env_id}/bulk/users)
- [Bulk `Replace` User](https://api.permit.io/scalar#tag/bulk-operations/PUT/v2/facts/{proj_id}/{env_id}/bulk/users)
- [Bulk `Assign Roles` to Users](https://api.permit.io/scalar#tag/bulk-operations/POST/v2/facts/{proj_id}/{env_id}/role_assignments/bulk)
- [Bulk `Unassign Roles` to Users](https://api.permit.io/scalar#tag/bulk-operations/DELETE/v2/facts/{proj_id}/{env_id}/role_assignments/bulk)
- [Bulk `Delete` User](https://api.permit.io/scalar#tag/bulk-operations/DELETE/v2/facts/{proj_id}/{env_id}/bulk/users)

## What did you learn?

Expand All @@ -185,7 +190,6 @@ In this guide, you’ve learned how to:
- Assign roles to a user either during creation or later through a dedicated API call.
- Understand Permit’s hierarchy (workspaces, projects, environments) and how it relates to API calls.


:::tip
Permit is fully API-driven, providing a seamless way to programmatically manage everything you can do via our
no-code UI.
Expand Down

0 comments on commit 0fd69a6

Please sign in to comment.