fastapi-permissions icon indicating copy to clipboard operation
fastapi-permissions copied to clipboard

Can't access pydantic principals

Open Master-Y0da opened this issue 2 years ago • 0 comments

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.

Master-Y0da avatar Jun 04 '22 20:06 Master-Y0da