Skip to content

Commit 3b0ea4c

Browse files
committed
fix: remove refs to DB in check_permissions
1 parent c6c69c6 commit 3b0ea4c

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

diracx-routers/src/diracx/routers/pilot_logging/remote_logger.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,7 @@ async def send_message(
4545
) -> int:
4646

4747
logger.warning(f"Message received '{data}'")
48-
user_info = await check_permissions(
49-
action=ActionType.CREATE, pilot_db=pilot_logs_db
50-
)
48+
user_info = await check_permissions(action=ActionType.CREATE)
5149
pilot_id = 0 # need to get pilot id from pilot_stamp (via PilotAgentsDB)
5250
# also add a timestamp to be able to select and delete logs based on pilot creation dates, even if corresponding
5351
# pilots have been already deleted from PilotAgentsDB (so the logs can live longer than pilots).
@@ -93,7 +91,7 @@ async def get_logs(
9391
) -> list[dict]:
9492

9593
logger.warning(f"Retrieving logs for pilot ID '{pilot_id}'")
96-
user_info = await check_permissions(action=ActionType.QUERY, pilot_db=db)
94+
user_info = await check_permissions(action=ActionType.QUERY)
9795

9896
# here, users with privileged properties will see logs from all VOs. Is it what we want ?
9997
search_params = [{"parameter": "PilotID", "operator": "eq", "value": pilot_id}]
@@ -122,7 +120,7 @@ async def delete(
122120
Non-privileged users can only delete log files within their own VO.
123121
"""
124122
message = "no-op"
125-
user_info = await check_permissions(action=ActionType.DELETE, pilot_db=db)
123+
user_info = await check_permissions(action=ActionType.DELETE)
126124
non_privil_params = {"parameter": "VO", "operator": "eq", "value": user_info.vo}
127125

128126
# id pilot_id is provided we ignore data.min and data.max

0 commit comments

Comments
 (0)