db_table
, report
, and excel_file
.
Each user has specific roles, and our authorization system is structured according to the confidentiality levels of these sources.
For instance, two users ask the same question: "Can you provide a list of all current clients, their contact details, and agreements?"
The response data is pulled from three different database tables:
- Companies table contains client company names and basic details.
- Contacts table holds the contact information (e.g., emails, phone numbers) for those client companies.
- Contracts table stores sensitive agreements, including terms, legal obligations, and pricing information.
Overview of Implementation in Permify
The authorization system in Permify is structured to manage access to various entities—db_table
, report
, and excel_file
—based on a user’s role within an organization or team and the confidentiality level assigned to each resource. This framework ensures that access permissions are applied consistently and securely across all resources.
Entities and Roles
- User: Represents an individual in the system.
- Organization: Contains two primary roles:
- Director: Has the highest level of access, able to view all resources with the highest confidentiality.
- Member: Regular members of the organization.
- Team: Has two primary roles:
- Lead: Manages the team and has access to most team-level resources.
- Member: General team participants with restricted access.
Confidentiality Levels
Resources are assigned aconfidentiality_level
attribute to define access restrictions. The levels include:
- Accessible by all organization members.
- Accessible by the organization’s
director
, teamlead
, and teammembers
. - Accessible by the organization’s
director
and the teamlead
. - Accessible only by the organization’s
director
.
Authorization Logic
Each resource entity (db_table
, report
, excel_file
) has a view
permission defined using the confidentiality
rules, which verifies the confidentiality level of the document/entity. The rule works as follows:
-
High Level Access (
4
):- Only users with the
director
role in the organization can view resources labeled with the4
confidentiality level.
- Only users with the
-
Medium-High Level Access (
3
):- Resources with this level are accessible to
directors
of the organization andleads
of the relevant team.
- Resources with this level are accessible to
-
Medium Level Access (
2
):- Accessible by team
leads
, teammembers
, anddirectors
of the organization.
- Accessible by team
-
Low Level Access (
1
):- Any
member
of the organization can access these resources.
- Any