MCPcopy Create free account
hub / github.com/dailydotdev/apps / canViewUserProfileAnalytics

Function canViewUserProfileAnalytics

packages/shared/src/lib/user.ts:401–413  ·  view source on GitHub ↗
({
  user,
  profileUserId,
}: {
  user?: Pick<LoggedUser, 'id' | 'isTeamMember'>;
  profileUserId?: string;
})

Source from the content-addressed store, hash-verified

399};
400
401export const canViewUserProfileAnalytics = ({
402 user,
403 profileUserId,
404}: {
405 user?: Pick<LoggedUser, 'id' | 'isTeamMember'>;
406 profileUserId?: string;
407}): boolean => {
408 if (user?.isTeamMember) {
409 return true;
410 }
411
412 return !!user?.id && user.id === profileUserId;
413};
414
415export const userProfileQueryOptions = ({ id }: { id: string }) => {
416 return {

Callers 1

ProfileWidgetsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected