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

Method is_user_owner

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

Check if a user is the owner of this organization.

(self, user_id: str | UUID)

Source from the content-addressed store, hash-verified

306 return False
307
308 def is_user_owner(self, user_id: str | UUID) -> bool:
309 """Check if a user is the owner of this organization."""
310 # If we have the current user role set from summary queries, use that
311 if hasattr(self, '_current_user_role') and normalize_uuid(user_id) == normalize_uuid(
312 getattr(self, '_current_user_id', user_id)
313 ):
314 return self._current_user_role == OrgRoles.owner
315
316 if membership := self.get_user_membership(user_id):
317 return membership.role == OrgRoles.owner
318
319 return False
320
321 @classmethod
322 def get_by_id(cls, orm: orm.Session, org_id: str | UUID) -> Optional['OrgModel']:

Callers 3

change_member_roleFunction · 0.80
delete_orgFunction · 0.80
delete_projectFunction · 0.80

Calls 2

get_user_membershipMethod · 0.95
normalize_uuidFunction · 0.70

Tested by

no test coverage detected