@@ -38,7 +44,20 @@ export function MembersPage() {
{isPending
? Array.from({ length: 8 }).map((_, i) => )
- : filtered.map((m) => )}
+ : filtered.map((m) => {
+ const canUpdate = ability.can('update', teamSubject(m));
+ return (
+
+ );
+ })}
>
);
diff --git a/src/pages/team/ui/projects/ProjectCard.tsx b/src/pages/team/ui/projects/ProjectCard.tsx
index 41a5ab9..40d0891 100644
--- a/src/pages/team/ui/projects/ProjectCard.tsx
+++ b/src/pages/team/ui/projects/ProjectCard.tsx
@@ -34,6 +34,14 @@ export type ProjectCardProps = ComponentProps
& {
name?: string;
description?: string;
statusLabel?: string;
+ permissions: Permissions;
+};
+
+type Permissions = {
+ canArchive: boolean;
+ canDelete: boolean;
+ canShare: boolean;
+ canRead: boolean;
};
const statusLabels: Record = {
@@ -49,8 +57,12 @@ export function ProjectCard({
name: nameProp,
description: descriptionProp,
statusLabel: statusLabelProp,
+ permissions,
...props
}: ProjectCardProps) {
+ const { canArchive, canDelete, canRead, canShare } = permissions;
+ const canManage = Object.values(permissions).every(Boolean);
+
const teamId = useTeamStore.use.teamId();
const name = nameProp ?? project?.name ?? 'Atlas Platform';
const description =
@@ -74,7 +86,7 @@ export function ProjectCard({
)}
{...props}
>
- {projectHref && (
+ {canRead && projectHref && (
-