Skip to content

Commit d28704b

Browse files
author
zhanglongbin
committed
Fix the bug of dataflow with ID #48
1 parent e42f260 commit d28704b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

data_server/operator/mapper/operator_mapper.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from data_server.operator.models.operator import OperatorInfo, OperatorConfig, OperatorConfigSelectOptions
33
from data_server.operator.models.operator_permission import OperatorPermission
44
from sqlalchemy.orm import Session
5+
from sqlalchemy import or_
56
from typing import List, Optional, Dict, Any
67
from datetime import datetime
78
from data_server.operator.schemas import OperatorResponse, OperatorConfigResponse, OperatorConfigSelectOptionsResponse
@@ -293,8 +294,12 @@ def get_operators_grouped_by_condition(db: Session, uuid: str, paths: List[str])
293294
# if_there_is_no_permission_display_all_operators
294295
operators = db.query(OperatorInfo).filter(OperatorInfo.is_public.is_(True)).order_by(OperatorInfo.id).all()
295296
else:
297+
# Return the operators within the permission scope plus all public operators within the authorized time limit
296298
operators = db.query(OperatorInfo).filter(
297-
OperatorInfo.id.in_(list(all_permitted_ids))
299+
or_(
300+
OperatorInfo.id.in_(list(all_permitted_ids)),
301+
OperatorInfo.is_public.is_(True)
302+
)
298303
).order_by(OperatorInfo.id).all()
299304

300305

0 commit comments

Comments
 (0)