Buckets:
AnonymousSpottedToad/candidate_bucket / codebase /python /mdfarhankc_fastapi-fullauth /fastapi_fullauth /models /beanie /role.py
| from uuid import UUID | |
| from beanie import Document | |
| from pydantic import Field | |
| from pymongo import IndexModel | |
| from fastapi_fullauth.models.beanie._common import uuid7 | |
| class RoleDocument(Document): | |
| """Role collection. Use directly or subclass. | |
| class Role(RoleDocument): | |
| pass | |
| A role's granted permissions are stored as an embedded ``permissions`` array | |
| on the role document (the authoritative role -> permission mapping), so | |
| resolving a user's permissions is a single read of the roles named on the | |
| user. The separate permission collection (see ``PermissionDocument``) is just | |
| the catalog of known permission names. | |
| """ | |
| id: UUID = Field(default_factory=uuid7) # type: ignore[assignment] | |
| name: str | |
| permissions: list[str] = Field(default_factory=list) | |
| class Settings: | |
| name = "fullauth_roles" | |
| indexes = [IndexModel("name", unique=True)] | |
Xet Storage Details
- Size:
- 919 Bytes
- Xet hash:
- e3cd49c61e032020bd171a85077460ec932bf55452fa7c8d2948670477f87d11
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.