holgi / fastapi-permissions

row level security for FastAPI framework
Other
475 stars 47 forks source link

Can't access pydantic principals #13

Open Master-Y0da opened 2 years ago

Master-Y0da commented 2 years ago

I create a pydantic model following the example described in package readme:

        class SuperUser(BaseModel):    
          username: Optional[str]

           def principals(self):
              return ["group:admin"]

But when I call get_active_principals function, it does not append the principal prop from superuser class...I think pydantic does not allow this.