Skip to content

Commit

Permalink
add ctx.user for operations
Browse files Browse the repository at this point in the history
  • Loading branch information
imanjra committed Aug 9, 2024
1 parent 6e3f77c commit a133e58
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions fiftyone/operators/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
import os
import traceback

from typing import Optional

import fiftyone as fo
import fiftyone.core.dataset as fod
import fiftyone.core.odm.utils as focu
Expand Down Expand Up @@ -477,6 +479,7 @@ def __init__(
self._dataset = None
self._view = None
self._ops = Operations(self)
self.user = None

self._set_progress = set_progress
self._delegated_operation_id = delegated_operation_id
Expand Down Expand Up @@ -648,6 +651,11 @@ def ops(self):
"""
return self._ops

@property
def user_id(self) -> Optional[str]:
"""The ID of the user executing the operation, if known."""
return self.user.id if self.user else None

def prompt(
self,
operator_uri,
Expand Down

0 comments on commit a133e58

Please sign in to comment.