🛂(frontend) show member list depend ability

We integrate the new ability "accesses_view" that
tells if a user can view the accesses of a document.
This commit is contained in:
Anthony LC
2024-10-24 17:21:33 +02:00
committed by Anthony LC
parent 15700ddd8d
commit 31c3dd6119
6 changed files with 46 additions and 13 deletions

View File

@@ -123,8 +123,12 @@ export const ModalShare = ({ onClose, doc }: ModalShareProps) => {
)}
</Box>
<Box $minHeight="0">
<InvitationList doc={doc} />
<MemberList doc={doc} />
{doc.abilities.accesses_view && (
<>
<InvitationList doc={doc} />
<MemberList doc={doc} />
</>
)}
</Box>
</Box>
</SideModal>

View File

@@ -44,10 +44,11 @@ export interface Doc {
created_at: string;
updated_at: string;
abilities: {
accesses_manage: boolean;
accesses_view: boolean;
attachment_upload: true;
destroy: boolean;
link_configuration: boolean;
accesses_manage: boolean;
partial_update: boolean;
retrieve: boolean;
update: boolean;

View File

@@ -194,16 +194,17 @@ export class ApiPlugin implements WorkboxPlugin {
created_at: new Date().toISOString(),
updated_at: new Date().toISOString(),
abilities: {
accesses_manage: true,
accesses_view: true,
attachment_upload: true,
destroy: true,
link_configuration: true,
partial_update: true,
retrieve: true,
update: true,
versions_destroy: true,
versions_list: true,
versions_retrieve: true,
accesses_manage: true,
update: true,
partial_update: true,
retrieve: true,
attachment_upload: true,
},
accesses: [
{