From 177c05d7dafb24ed5853adf5389d65d6aa1d218c Mon Sep 17 00:00:00 2001 From: Ricky Stretch Date: Mon, 16 Mar 2026 19:14:04 -0400 Subject: [PATCH] v0.9.43 user group dm permissions fixed --- .env.example | 2 +- backend/package.json | 2 +- build.sh | 2 +- frontend/package.json | 2 +- frontend/src/components/GroupInfoModal.jsx | 24 ++++++++++++++-------- 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/.env.example b/.env.example index 1365661..faf6f07 100644 --- a/.env.example +++ b/.env.example @@ -10,7 +10,7 @@ PROJECT_NAME=jama # Image version to run (set by build.sh, or use 'latest') -JAMA_VERSION=0.9.42 +JAMA_VERSION=0.9.43 # App port — the host port Docker maps to the container PORT=3000 diff --git a/backend/package.json b/backend/package.json index 8ae2240..a6dbc17 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "jama-backend", - "version": "0.9.42", + "version": "0.9.43", "description": "TeamChat backend server", "main": "src/index.js", "scripts": { diff --git a/build.sh b/build.sh index 7a96382..839b749 100644 --- a/build.sh +++ b/build.sh @@ -13,7 +13,7 @@ # ───────────────────────────────────────────────────────────── set -euo pipefail -VERSION="${1:-0.9.42}" +VERSION="${1:-0.9.43}" ACTION="${2:-}" REGISTRY="${REGISTRY:-}" IMAGE_NAME="jama" diff --git a/frontend/package.json b/frontend/package.json index 400cfe0..abc38f1 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "jama-frontend", - "version": "0.9.42", + "version": "0.9.43", "private": true, "scripts": { "dev": "vite", diff --git a/frontend/src/components/GroupInfoModal.jsx b/frontend/src/components/GroupInfoModal.jsx index 15b8820..da3164a 100644 --- a/frontend/src/components/GroupInfoModal.jsx +++ b/frontend/src/components/GroupInfoModal.jsx @@ -17,10 +17,11 @@ export default function GroupInfoModal({ group, onClose, onUpdated, onBack }) { const [savingCustom, setSavingCustom] = useState(false); const isDirect = !!group.is_direct; + const isManaged = !!group.is_managed; // UG DM or Multi-Group DM — only editable via Group Manager const isOwner = group.owner_id === user.id; const isAdmin = user.role === 'admin'; - const canManage = !isDirect && ((group.type === 'private' && isOwner) || (group.type === 'public' && isAdmin)); - const canRename = !isDirect && !group.is_default && ((group.type === 'public' && isAdmin) || (group.type === 'private' && isOwner)); + const canManage = !isDirect && !isManaged && ((group.type === 'private' && isOwner) || (group.type === 'public' && isAdmin)); + const canRename = !isDirect && !isManaged && !group.is_default && ((group.type === 'public' && isAdmin) || (group.type === 'private' && isOwner)); useEffect(() => { if (group.type === 'private') { @@ -116,8 +117,8 @@ export default function GroupInfoModal({ group, onClose, onUpdated, onBack }) { }; // For direct messages: only show Delete button (owner = remaining user after other left) - const canDeleteDirect = isDirect && isOwner; - const canDeleteRegular = !isDirect && (isOwner || (isAdmin && group.type === 'public')) && !group.is_default; + const canDeleteDirect = isDirect && isOwner && !isManaged; + const canDeleteRegular = !isDirect && !isManaged && (isOwner || (isAdmin && group.type === 'public')) && !group.is_default; return (
e.target === e.currentTarget && onClose()}> @@ -236,16 +237,23 @@ export default function GroupInfoModal({ group, onClose, onUpdated, onBack }) { {/* Actions */}
+ {/* Managed group notice */} + {isManaged && ( +
+ + This conversation is managed via the Group Manager tool. +
+ )} {/* Direct message: leave (if not already owner/last person) */} - {isDirect && !isOwner && ( + {isDirect && !isManaged && !isOwner && ( )} {/* Regular private: leave if not owner */} - {!isDirect && group.type === 'private' && !isOwner && ( + {!isDirect && !isManaged && group.type === 'private' && !isOwner && ( )} - {/* Admin take ownership (non-direct only) */} - {!isDirect && isAdmin && group.type === 'private' && !isOwner && ( + {/* Admin take ownership (non-direct, non-managed only) */} + {!isDirect && !isManaged && isAdmin && group.type === 'private' && !isOwner && ( )} {/* Delete */}