fec3953009
- Three category scopes: personal / group / system (watch) - PascalCase-with-dashes naming convention enforced at backend + frontend - is_group_admin flag on GroupMembership; PATCH endpoint for admins to toggle it - Categories router: scope-based list/create/rename/delete with _check_can_manage_cat - Documents router: delete uses is_admin + can_delete share flag + group-admin check; remove_category requires doc ownership; assign_category accepts group/system categories - Proxy layers inject x-user-is-admin and x-user-admin-groups headers - Frontend: ManageCategoriesDialog grouped by scope with lock icons; SourcePanel scope picker + client-side name validation; AdminGroupsPage group-admin checkbox Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
43 lines
903 B
Python
43 lines
903 B
Python
from datetime import datetime
|
|
|
|
from pydantic import BaseModel, Field
|
|
|
|
|
|
class GroupCreate(BaseModel):
|
|
name: str = Field(..., min_length=1, max_length=128)
|
|
description: str | None = Field(None, max_length=512)
|
|
|
|
|
|
class GroupUpdate(BaseModel):
|
|
name: str | None = Field(None, min_length=1, max_length=128)
|
|
description: str | None = Field(None, max_length=512)
|
|
|
|
|
|
class GroupMemberOut(BaseModel):
|
|
id: str
|
|
email: str
|
|
full_name: str | None
|
|
is_active: bool
|
|
is_group_admin: bool = False
|
|
joined_at: datetime
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class GroupMemberAdminUpdate(BaseModel):
|
|
is_group_admin: bool
|
|
|
|
|
|
class GroupOut(BaseModel):
|
|
id: str
|
|
name: str
|
|
description: str | None
|
|
created_at: datetime
|
|
member_count: int = 0
|
|
|
|
model_config = {"from_attributes": True}
|
|
|
|
|
|
class GroupDetailOut(GroupOut):
|
|
members: list[GroupMemberOut] = []
|