mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-25 20:27:44 +02:00
Adjust permissions for unclaimed participants
This commit is contained in:
parent
5c991d7011
commit
ccc2896b2d
3 changed files with 31 additions and 24 deletions
|
@ -11,14 +11,16 @@ export type SessionProps = {
|
|||
user: UserSessionData | null;
|
||||
};
|
||||
|
||||
type ParticipantOrComment = {
|
||||
userId: string | null;
|
||||
guestId: string | null;
|
||||
};
|
||||
|
||||
type SessionContextValue = {
|
||||
logout: () => Promise<void>;
|
||||
user: (UserSessionData & { shortName: string }) | null;
|
||||
refresh: () => void;
|
||||
ownsObject: (obj: {
|
||||
userId: string | null;
|
||||
guestId: string | null;
|
||||
}) => boolean;
|
||||
ownsObject: (obj: ParticipantOrComment) => boolean;
|
||||
isLoading: boolean;
|
||||
};
|
||||
|
||||
|
@ -101,3 +103,6 @@ export const withSession = <P extends SessionProps>(
|
|||
ComposedComponent.displayName = component.displayName;
|
||||
return ComposedComponent;
|
||||
};
|
||||
|
||||
export const isUnclaimed = (obj: ParticipantOrComment) =>
|
||||
!obj.guestId && !obj.userId;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue