Hi there, I’m a fullstack developer working on an ...
# permit-saas
b
Hi there, I’m a fullstack developer working on an application using a microservice architecture, where we process vehicle-related data.Our company plans to sell the system as a subscription-based service, but the development is still in its early stages. Many permissions are expected to change, and the exact boundaries of subscription tiers and their associated permissions have not yet been defined. I’m looking for an authorization service built on Permit.io that can: • Provide a flexible interface for mapping roles and permissions. • Restrict organizational members to access only within their own organization (e.g., an orgAdmin can modify data only for their own organization, and an orgUser can view vehicle data only within their organization). • Here, I’m curious whether it’s better to use multi-tenant RBAC, or ABAC where orgID is an attribute on both the user and the resource, and policies check for matches. What is the best practice in such a scenario? Or is there a third approach that might better address this use case? • Support role derivation, so that, for example, an orgAdmin role can be overridden for a specific company (e.g., as concreteOrgAdmin), while retaining the permissions of the original OrgAdmin role, but allowing additional rules—such as enabling or denying specific permissions. • Later, we plan to limit subscription tiers based on quotas. This is partly an authorization question, and I’m not sure how suitable Permit.io is for handling such data. Should these quotas be implemented in Permit.io (e.g., number of data queries, amount of data retrieved stored in the database, with authorization decisions based on these values)? Could these values be added as user attributes in Permit.io? Thanks in advance for your guidance!
a
Hi @Bálint Richly, I'm an AI assistant for Permit.io. I'll analyze available sources and get back to you shortly.
* Based on your requirements for a vehicle data microservice architecture with organizational boundaries and evolving permissions, Permit.io can address all your needs. Let me break down each requirement: Multi-tenant RBAC vs ABAC for Organizational Boundaries For organizational isolation, Permit.io's multi-tenant architecture with tenant boundaries is the recommended approach. Resource instances must always belong to a tenant to maintain tenant boundaries for end-customers (1) . The tenant can signify a completely separated end-customer account on your system . ABAC with orgID attributes is also viable - you can define user attributes and resource attributes to create context-specific policies (2) (3) . ABAC enables highly precise policy-making by considering attributes like organization membership (3) . The hybrid approach combining both models often works best . You can start with RBAC and gradually evolve into ABAC as additional attributes are required . Role Derivation and Inheritance Permit.io supports role derivation where a role on one resource automatically grants another role on related resources (1) (4) . For example:
Copy code
await permit.api.resource_roles.update(
    "file",
    "editor",
    {
        "granted_to": {
            "users_with_role": [
                {
                    "linked_by_relation": "parent",
                    "on_resource": "folder",
                    "role": "editor",
                },
            ],
        },
    }
)
(4) This allows creating specialized roles (like your concreteOrgAdmin) that inherit base permissions while adding specific rules. Subscription Tiers and Quotas Permit.io recently introduced quota management in their pricing model (5) . They handle quotas on resources and rules that clients can define within the system . For subscription-based limitations, you can: • Use user attributes to store quota values (2) • Create ABAC policies that check these attributes against resource usage (3) • Define conditions like checking if a user's subscription tier allows certain actions (6) Example ABAC approach for quota checking: • Store quotas as user attributes (e.g.,
maxQueries
,
dataLimit
) (2) • Create resource sets based on data volume (6) • Define user sets based on subscription attributes • Create policies linking user sets to resource sets with specific conditions Flexible Permission Mapping Permit.io provides: • A no-code UI for managing roles and permissions (3) • GitOps workflows for version-controlled permission changes (5) • Dynamic policy adjustments without code changes (3) • Real-time policy updates to your application This flexibility is crucial for your early-stage development where permissions frequently change. The platform supports combining RBAC, ABAC, and ReBAC in one interface , allowing smooth transitions between authorization models without application code changes .
To learn more, see the sources I considered: [[1] Modeling Google Drive Permissions with ReBAC](https://docs.permit.io/modeling/google-drive) [[2] Defining Attributes](https://docs.permit.io/how-to/build-policies/abac/defining-attributes) [[3] What Is Attribute-Based Access Control (ABAC)?](https://www.permit.io/blog/what-is-abac) [[4] Modeling Google Drive Permissions with ReBAC](https://docs.permit.io/modeling/google-drive) [[5] Permit.io Announces a New Pricing Model](https://www.permit.io/blog/permit-new-pricing-model) [[6] Fine-Grained Keycloak Authorization with ABAC and ReBAC](https://www.permit.io/blog/fine-grained-keycloak-authorization-with-abac-and-rebac)
a
Hey @Bálint Richly , welcome (: Feel free to ask more questions, Meanwhile, did the AI answered all your questions?
o
AI gave a good answer. In general we'd recommend simpler solutions first (i.e. RBAC with tenants before ABAC), the beauty of Permit.io is that you can very easily and quickly change your policies, so you can iterate quickly starting simple and adding complexity on the go.