update
This commit is contained in:
@@ -282,8 +282,13 @@ def _guard_plan(plan: Plan, request: PlanRequest) -> Plan:
|
||||
query.filters["status"] = "active"
|
||||
if query.resource in {"tasks", "task-assignees"} and ("date_from" in query.filters) != ("date_to" in query.filters):
|
||||
return Plan(clarification="请提供完整的任务起止日期。", routing=plan.routing)
|
||||
if query.resource in {"tasks", "task-assignees"} and query.scope == "accessible" and not request.allow_organization:
|
||||
if (query.resource in {"tasks", "task-assignees"} and not request.allow_organization
|
||||
and (query.scope == "accessible" or query.filters.get("person_name") or query.filters.get("person_id"))):
|
||||
return Plan(clarification="当前账号没有部门任务查询权限,可以查询本人的工作。", routing=plan.routing)
|
||||
if query.resource in {"tasks", "task-assignees"} and (query.filters.get("person_name") or query.filters.get("person_id")):
|
||||
# A named subject must not be intersected with the actor's own tasks.
|
||||
# Organization capability was checked above; SQL still applies role scope.
|
||||
query.scope = "accessible"
|
||||
if resource.get("scope") == "personal" and query.scope != "mine":
|
||||
return Plan(clarification="当前这项查询只提供本人范围,部门汇总尚未开放。", routing=plan.routing)
|
||||
if query.operation == "count":
|
||||
|
||||
Reference in New Issue
Block a user