This message was deleted.
# permit-saas
s
This message was deleted.
a
Hi @Liam Taylor, I'm an AI assistant for Permit.io. I'll analyze available sources and get back to you shortly.
l
my understanding of how i might got about this is as follows. this is based on using the PDP/Python SDK • in a view, extract the data to be filtered from the database • serialize it (or a subset of the data) • call
Permit.filter_objects
with this data and the rest of the required stuff, which return the filtered data set • (if the data sent to permit is a subset of the data the full data set based on the
filter_objects
response
a
Hey! Great to hear you're exploring Permit.io for ReBAC data filtering in your Django project! I'm ready to help with your implementation questions. Permit.io supports data filtering through multiple approaches including PDP-Level Filtering and filtering based on the Information Graph (1) . For Django specifically, you can implement ReBAC (Relationship-Based Access Control) which extends beyond basic RBAC by considering relationships between identities and resources (2) . To get started with Django and Permit.io, you'll need to: 1. Initialize the Permit client in your Django project :
Copy code
from permit import Permit
from dotenv import load_dotenv
import os

load_dotenv()

permit = Permit(
    pdp=os.getenv("PERMIT_PDP_URL") ,
    token=os.getenv("PERMIT_SDK_KEY")
)
2. For ReBAC implementation, you'll need to run a local PDP container :
Copy code
docker pull permitio/pdp-v2:latest
docker run -it -p 7766:7000 \
    --env PDP_DEBUG=True \
    --env PDP_API_KEY=<YOUR_API_KEY> \
    permitio/pdp-v2:latest
The data filtering capabilities include methods like
filterObjects
for PDP-level filtering and functions like
getUserPermissions
and
getAuthorizedUsers
for filtering based on the information graph (1) . Feel free to share your specific questions in the thread - I'm here to help with the implementation details!
l
under the hood, my understanding is that permit • makes an external API call to get relevant permissions • filters the data in python code based on those permissions
currently our filtering is applied as the database layer. i'm worried that this approach wouldn't be scalable based on latency of building in an external API request, the amount of date needing to be transferred (if all filtering logic is covered by permit, then that is effectively always an entire database table), and the efficiency of filtering large data sets in python.
can you advise to this end? i am very aware that i am possibly misinterpreting certain things. ideally i would be able to use permit's permissions to create appropriate SQL queries that reflect the permissions. this is in line with the source-level filtering references in this section of the docs - is there any guidance on implementing this? is this out of the box functionality?
a
To learn more, see the sources I considered: [[1] Data Filtering](https://docs.permit.io/how-to/enforce-permissions/data-filtering) [[2] Django Authorization: An Implementation Guide](https://www.permit.io/blog/django-authorization-an-implementation-guide)