Hi Team, We have need to implement a simple RBAC +...
# general
m
Hi Team, We have need to implement a simple RBAC + ReBAC access control model and I'd like to validate the approach and design. Our Use Case I have a system with organizations, and each organization contains projects and users. Every user in an organization is assigned the member role by default. Members are allowed to create projects. Each project has its own project-level roles: - project_admin - project_member When a user (who is an member) creates a project, they automatically become the project_admin for that specific project. A project_admin can: Add or remove project_members Add or remove project_admins Current Permission Model Resource Types - project Roles - member - project#project_admin - project#project_member Each role has specific allowed actions on the resource types. Example permission check:
Copy code
{
  "user": {
    "key": "user_id1"
  },
  "action": "create",
  "resource": {
    "type": "project",
    "tenant": "default",
    "key": "project_test10"
  },
  "context": {}
}
Is this RBAC + ReBAC design and resource-instance model valid for Permit.io for this use case? Any other design options/candidates that you'd recommend? In the first iteration, we'd like to use the cloud PDP exclusively without a local PDP setup. Is there a another approach where this kind of permission model can be supported by exclusively using cloud PDP?
a
Hey @Mihiru Kongahage, glad you reached out! Feel free to ask any questions in #permit-saas so the team and our AI can respond faster 🙂
✅ 1
Meanwhile, @Ask Inkeep
a
Thanks for tagging me @Alon Boshi. I'll look through relevant sources and get back to you shortly.
Your RBAC + ReBAC design is valid for Permit.io. ReBAC is perfect for handling hierarchical structures where permissions are derived from relationships (1) (2) . Your model with organization-level roles (member) and resource-specific roles (project#project_admin, project#project_member) aligns with ReBAC's resource roles pattern (3) . For resource roles in ReBAC, Permit.io uses the Resource#Role format (1) (3) , which matches your design: • project#project_admin • project#project_member ReBAC allows you to derive authorization policies based on existing application-level relationships (1) . This means a user assigned as project#project_admin on a specific project instance will have admin permissions only for that project (3) . Regarding Cloud PDP usage: The Cloud PDP has limitations (4) (5) . According to the documentation, "the Cloud PDP is NOT compatible with Attribute-based Access Control policies (ABAC) and also Relationship-based Access Control (ReBAC) policies" . For ReBAC implementation, you'll need to use the container PDP :
Copy code
docker pull permitio/pdp-v2:latest
(4)
Copy code
docker run -it -p 7766:7000 --env PDP_DEBUG=True --env PDP_API_KEY=<YOUR_API_KEY> permitio/pdp-v2:latest
(4) (5) The Cloud PDP is designed for "quick experimentation with Permit" but "in production deployments, it is best to deploy the Docker Container PDP for better latency and availability" (5) . Your permission check structure looks correct for checking project-level permissions with the tenant context included .
To learn more, see the sources I considered: [[1] Role-Based Access Control (RBAC) VS. Relationship-Based Access Control (ReBAC)](https://www.permit.io/blog/rbac-vs-rebac) [[2] What is Relationship-Based Access Control (ReBAC)?](https://www.permit.io/blog/what-is-rebac) [[3] Build Authorization Like Google](https://www.permit.io/blog/build-authorization-like-google) [[4] Run the PDP (Policy Decision Point)](https://docs.permit.io/overview/run-pdp) [[5] Running a demo](https://docs.permit.io/overview/connecting-your-app)
o
Note the current cloud-PDP - doesn’t support ReBAC We are planning to release a production ready Cloud PDP with RBAC + ReBAC support, as early as later this week.
👍 1
m
We are currently using the RBAC + ReBAC approach with the Local PDP. After the new Cloud PDP release, will we be able to migrate smoothly without any breaking changes? Also want to confirm that the updated Cloud PDP will work seamlessly with both the SDK and the API. If possible, please share any documentation or a roadmap related to this release.
a
Hey @Mihiru Kongahage, let me check with the team and I will circle back to you soon
Yes — the migration from the Local PDP to the new Cloud PDP should be smooth and fully backward-compatible. For all supported RBAC + ReBAC setups, the only change required will be updating the PDP endpoint URL. No breaking changes are expected. The updated Cloud PDP will also work seamlessly with both the SDK and the API, so your current integration patterns remain the same. By the way, as of now the Cloud PDP is scheduled to go to production this week, and we’ll update once it’s live. @Mihiru Kongahage
m
Thanks Alon
o
please expect the new cloud PDP on Monday
o
Hey @Mihiru Kongahage The Cloud PDP is released as EAP ( Early Access Program ). I can activate it for you, to do that I’ll need your environment id ( or workspace, project, environment keys ). The docs for it is still not live and is currently in finalization, you can check the preview of it here - let us know if you have any questions or comments on it as we are still writing it down.
👍 1
m
Hi @Or Weis We’re integrating permit.io to an application deployed in a network restricted environment. Can you please specify the host names, protocols, ports, etc that must be excluded/whitelisted in order for the PDP to function properly?
o
Hey @Mihiru Kongahage are you referring to the Cloud PDP or the Edge PDP ( container based )
m
We are trying both options. Both Enhanced cloud pdp and the edge pdp
o
I understand, please note that I provide hostnames and we do not provide static ips: Cloud PDP: • Hostnames ◦ cloudpdp.api.permit.io ◦ cloud-pdp.api.permit.io ◦ api.permit.io • Protocols ◦ HTTPS Edge PDP: • Hostnames ◦ api.permit.io ◦ opal-v2.permit.io ◦ pdp-data.api.permit.io ◦ pdp-delta.api.permit.io ◦ decision-log-ingress.api.permit.io ◦ relay-jwt.api.permit.io ◦ opal-relay.api.permit.io • Protocols ◦ HTTPS ◦ WSS Note that the Edge PDP used hostnames might change in future versions. Also note that I might have missed some hostnames, especially for the Edge PDP 😅
m
No Worries 😅 Thank you
b
Hi @Omer Zuarets thanks for the response. I have couple of followup questions: 1. Can you guarantee that with these host name & protocol exclusions, the Edge PDP will function properly? 2. Would there be an official communication to permit.io users ahead of time if the Edge PDP host names were to change?
o
1. Yes. 2. Yes. At the minimum it would be recorded in the PDP version's release notes BTW @Bashwara Undupitiya, @Mihiru Kongahage which company are you with?
thanks 1
b
thank you for the response Or! both Mihiru and I are part of Verdentra
m
Hi @Or Weis 1. When initializing the client SDK with local PDP URL does all traffic get mediated through the local PDP or does the client also directly connects to cloud? This is from a networking rules standpoint. 2. We noticed that we don't have a way to query role assignments through SDK, we did that through the API directly (URL: BASE_URL/v2/facts/{projectId}/{envId}/role_assignments?{queryParams}). Is there any plans to support this functionality in SDK in the future?
a
Hey @Mihiru Kongahage, I'll ask the team and meanwhile I'll let @Ask Inkeep try to answer this
a
Thanks for tagging me @Alon Boshi. I'll look through relevant sources and get back to you shortly.
* ​*1. Traffic flow with local PDP:*​ When you initialize the SDK with a local PDP URL, permission checks (
permit.check()
) go to your local PDP container. (1) (2) (3) (4) The local PDP itself connects to Permit.io's cloud services (like
api.permit.io
,
opal-v2.permit.io
, etc.) to fetch policies and sync data. (5) (6) So from a networking standpoint: • ​*SDK → Local PDP*​: Your application only talks to your local PDP for authorization checks • ​*Local PDP → Permit Cloud*​: The PDP connects outbound to Permit's cloud services for policy updates and data sync Your application code doesn't directly connect to Permit's cloud for permission checks when using a local PDP—only the PDP container does. ​*2. Querying role assignments via SDK:*​ I don't have specific documentation on SDK support for querying role assignments. The sources I have access to focus on permission checks and user sync operations rather than listing role assignments. You're correct that this is currently available via the API directly. * I'd recommend reaching out to the team directly (as Alon mentioned) for confirmation on the SDK roadmap for role assignment queries, and for any additional networking details specific to your deployment.
To learn more, see the sources I considered: [[1] Java Quickstart](https://docs.permit.io/sdk/java/quickstart-java) [[2] Dot Net Quickstart](https://docs.permit.io/sdk/dotnet/quickstart-dotnet) [[3] Golang Quickstart](https://docs.permit.io/sdk/golang/quickstart-golang) [[4] Python Quickstart Async](https://docs.permit.io/sdk/python/quickstart-python) [[5] Unable to push the policy data since OPA is not ready yet in sidecar pattern](https://github.com/permitio/PDP/issues/266) [[6] Docker image errors out - cannot get config from control plane](https://github.com/permitio/PDP/issues/251)
m
Hey @Alon Boshi Have a follow up question for the AI response The response specifically says it does not directly connect to cloud for permit check. Are there other scenarios where the SDK will directly talks to the permit cloud (ex: When creating resource or when syncing users)? or whether all SDK communication go through the PDP?
a
The SDK talks to the PDP for permission checks. Operations like creating data or updating policy schema go directly to the Permit API (anything under
permit.api.*
).
m
Is user syncing classified as a data creation operation?
a
Yes, user syncing can be classified as a data creation operation. The
syncUser
function creates a user if they don't exist, or updates them if they already do. Please expand here @Ask Inkeep
a
Thanks for tagging me @Alon Boshi. I'll look through relevant sources and get back to you shortly.
Yes,
syncUser
is a data operation that goes directly to the Permit API (cloud) , not through the PDP. (1) (2) The
syncUser
function saves a user's information to the Permit.io cloud and PDP upon user creation. (1) It should be used for initial user creation and when syncing users between your authentication solution and Permit. Here's how it works in Node.js:
Copy code
const user = await permit.api.syncUser(user) ;
And in .NET:
Copy code
var user = await permitClient.Api.SyncUser(userObj) ;
(3) Notice the
permit.api.*
pattern—this indicates it's an API operation that communicates directly with Permit's cloud services, not a permission check that goes through the PDP. (1) (3) The recommended approach is to call
syncUser()
immediately after authentication to ensure user data is up-to-date in Permit. (2) You can also assign roles during sync by including
role_assignments
in the request. (4) For bulk user operations, you can use the bulk API endpoints instead:
Copy code
curl -X POST https://api.permit.io/v2/facts/{proj_id}/{env_id}/bulk/users \
  -H "Authorization: Bearer {your_permit_token}" \
  -H "Content-Type: application/json" \
  -d '{
    "operations": [{
      "key": "jane_doe",
      "email": "jane@coolcompany.com",
      "first_name": "Jane",
      "last_name": "Doe",
      "attributes": {}
    }, ...]
  }'
(4)
b
thanks for the response! @Alon Boshi based on the previous conversation regarding network exclusions (you can refer up the this thread for context), our understanding was that all permit.io communications were done through the PDP and that individual application services which have used the permit.io SDK would only talk to the PDP and not the permit.io cloud API directly. But based on the above responses, it seems like that some operations are done directly against the cloud API which would require each service to have network exclusions to the required permit.io cloud APIs. Is this an accurate description considering our use case? consider the following example using a k8s cluster: - deploy PDP in it's own namespace with the required network exclusions (already done) - service 1 implements the SDK and handles user syncing operation -> would service 1 also require network exclusions to permit.io cloud API? Additionally, we want to understand the latency impacts that might be caused due to direct API calls to the permit.io cloud API. Do you provide regional servers? Does the regional selection happen automatically? (eg: US IP -> US Server, EU IP -> EU Server) and does it require a specific pricing tier?
a
@Ask Inkeep
a
Thanks for tagging me @Alon Boshi. I'll look through relevant sources and get back to you shortly.
Your understanding is correct. The SDK has two communication paths: 1. *Permission checks (
permit.check()
) *
→ go to your local PDP (1) (2) 2. **API operations (
permit.api.*
like
syncUser
, creating resources, etc.) ** → go directly to Permit.io cloud (
api.permit.io
) (3) So yes, ​*Service 1 would require network exclusions to `api.permit.io`*​ (HTTPS) for user syncing and other data operations. ​*Regarding latency and regional servers:*​ I don't have specific documentation on regional server selection or automatic routing based on IP location. The control plane URL defaults to
https://api.permit.io
. For enterprise deployments with specific regional requirements, the documentation mentions: "Custom cloud PDP deployments are available to enterprise tier customers. Those can include different regions, cloud providers, custom SSL/TLS configurations or other specifications. Please reach out to us at support@permit.io" (1) I'd recommend reaching out to the team directly for details on: • Regional API availability • Latency expectations for direct API calls from your region • Whether automatic regional routing exists
To learn more, see the sources I considered: [[1] Permit's PDP (Policy Decision Point)](https://docs.permit.io/concepts/pdp/overview) [[2] Running a demo](https://docs.permit.io/overview/connecting-your-app) [[3] Configurations](https://docs.permit.io/concepts/pdp/configuration)
a
maybe consider using
proxy_facts_via_pdp
@Ask Inkeep please expand
a
Thanks for tagging me @Alon Boshi. I'll look through relevant sources and get back to you shortly.
proxy_facts_via_pdp
is exactly what you need for your network-restricted environment. (1) When enabled, this feature routes data operations (like user syncing, creating resources, role assignments) ​*through your local PDP*​ instead of directly to the Permit cloud API. This means Service 1 would only need network access to your PDP—the PDP handles the cloud communication. ​*How it works:*​ With
proxy_facts_via_pdp
enabled, the SDK sends fact operations to your PDP at
/facts/...
endpoints, and the PDP forwards them to the Permit API. ​*Python example:*​
Copy code
from permit import Permit

permit = Permit(
    token="<your-api-key>",
    pdp="http://localhost:7766",
    proxy_facts_via_pdp=True
)

# This now goes through PDP, not directly to cloud
user = await permit.api.users.create({
    "key": "user123",
    "email": "user@example.com"
})
, (2) ​*Supported operations via PDP proxy:*​ (1) •
POST /facts/users
•
PUT /facts/users/{user_id}
•
PATCH /facts/users/{user_id}
•
POST /facts/tenants
•
POST /facts/users/{user_id}/roles
•
POST /facts/role_assignments
•
POST /facts/resource_instances
•
POST /facts/relationship_tuples
​*Bonus:*​ This also enables "read-your-own-writes" consistency—permission checks work immediately after creating data, without sync delays. ​*Minimum PDP version required:*​
0.5.1
or above.