MCPcopy Create free account
hub / github.com/AgentOps-AI/agentops / set_current_user

Method set_current_user

app/api/agentops/opsboard/models.py:165–173  ·  view source on GitHub ↗

Set the current user for this organization. THis is the user performing the request. This allows us to access `current_user_role` as a property later.

(self, user_id: str | UUID)

Source from the content-addressed store, hash-verified

163 invites = orm.relationship("OrgInviteModel", back_populates="org", cascade="all, delete-orphan")
164
165 def set_current_user(self, user_id: str | UUID) -> None:
166 """
167 Set the current user for this organization. THis is the user performing
168 the request.
169
170 This allows us to access `current_user_role` as a property later.
171 """
172 user_org = self.get_user_membership(user_id)
173 self._current_user_role = user_org.role
174
175 @property
176 def current_user_role(self) -> OrgRoles:

Callers 8

create_orgFunction · 0.95
get_all_for_userMethod · 0.80
get_all_for_userMethod · 0.80
get_orgFunction · 0.80
get_projectFunction · 0.80
create_projectFunction · 0.80
update_projectFunction · 0.80
regenerate_api_keyFunction · 0.80

Calls 1

get_user_membershipMethod · 0.95

Tested by

no test coverage detected