feat: add role/permission system with tests support
- Add Role model with 17 default permissions - Add init_wizard to create admin/guest roles on first startup - Protect admin role from modification/deletion via API - Fix MilestoneCreate schema (project_id optional) - Fix delete role to clean up role_permissions first - Add check_project_role RBAC function
This commit is contained in:
@@ -54,6 +54,8 @@ def create_milestone(project_id: int, milestone: schemas.MilestoneCreate, db: Se
|
||||
milestone_code = f"{project_code}:{next_num:05x}"
|
||||
|
||||
data = milestone.model_dump()
|
||||
# Remove project_id from data if present (it's already in the URL path)
|
||||
data.pop('project_id', None)
|
||||
# Handle JSON fields
|
||||
if data.get("depend_on_milestones"):
|
||||
data["depend_on_milestones"] = json.dumps(data["depend_on_milestones"])
|
||||
|
||||
Reference in New Issue
Block a user