Download app/schemas/admin/role_mgmt.py from binhugg2/api: direct link, hf CLI and curl.
- Browser
- Download file 592 Bytes
-
https://huggingface.co/spaces/binhugg2/api/resolve/main/app/schemas/admin/role_mgmt.py
- Command line
-
hf download hf://spaces/binhugg2/api/app/schemas/admin/role_mgmt.py
-
curl -L -o role_mgmt.py https://huggingface.co/spaces/binhugg2/api/resolve/main/app/schemas/admin/role_mgmt.py
592 Bytes
| from pydantic import BaseModel, Field | |
| class RoleCreateRequest(BaseModel): | |
| name: str = Field(..., min_length=1, max_length=50) | |
| code: str = Field(..., min_length=1, max_length=50, pattern=r"^[a-zA-Z0-9_]+$") | |
| description: str | None = Field(None, max_length=200) | |
| class RoleUpdateRequest(BaseModel): | |
| name: str | None = Field(None, min_length=1, max_length=50) | |
| description: str | None = Field(None, max_length=200) | |
| status: int | None = Field(None, ge=0, le=1) | |
| class RoleAssignPermissionsRequest(BaseModel): | |
| permission_ids: list[int] = Field(default_factory=list) | |