Skip to content

Open-source AI teammates in Slack, Teams, Discord, Telegram and Mattermost. Self-host it, with any agent harness and any model.

Show the Gateway's room and agent controls to the people the server lets use them

Abel Dantasb7fe75d86994
diff --git a/gateway/src/pages/agents/AgentDetailPage.tsx b/gateway/src/pages/agents/AgentDetailPage.tsx
index 485edd00a..4137d77b3 100644
--- a/gateway/src/pages/agents/AgentDetailPage.tsx
+++ b/gateway/src/pages/agents/AgentDetailPage.tsx
@@ -78,7 +78,7 @@ function StatusDot({ color, title }: { color: string; title?: string }) {
export default function AgentDetailPage() {
const { agentId } = useParams<{ agentId: string }>();
const navigate = useNavigate();
- const { user } = useAuth();
+ const { user, canAdminTenant } = useAuth();
const { data: agent, loading, error, refetch } = useAgent(agentId);
const [renameOpen, setRenameOpen] = useState(false);
const [renameNotice, setRenameNotice] = useState<{
@@ -178,7 +178,7 @@ export default function AgentDetailPage() {
<Divider />
<AddressingPolicySection
agent={agent}
- canEdit={isOwner}
+ canEdit={isOwner || canAdminTenant}
onUpdated={refetch}
/>
<AgentManagementSection
diff --git a/gateway/src/pages/rooms/RoomDetailPage.tsx b/gateway/src/pages/rooms/RoomDetailPage.tsx
index 5877c7172..e7a50ed2a 100644
--- a/gateway/src/pages/rooms/RoomDetailPage.tsx
+++ b/gateway/src/pages/rooms/RoomDetailPage.tsx
@@ -138,7 +138,7 @@ export default function RoomDetailPage() {
onSaved={refetch}
/>
<Divider />
- <ParticipantsSection room={room} onChanged={refetch} />
+ <ParticipantsSection room={room} canWrite={canWrite} onChanged={refetch} />
<Divider />
<RoomResourcesSection roomId={room.id} />
<Divider />
@@ -712,9 +712,11 @@ function EditableFieldsSection({
function ParticipantsSection({
room,
+ canWrite,
onChanged,
}: {
room: RoomDetail;
+ canWrite: boolean;
onChanged: () => void;
}) {
const { data: allAgents, loading: agentsLoading } = useAgents();
@@ -859,10 +861,12 @@ function ParticipantsSection({
status={room.agent_statuses[id]}
receivesJoinEvents={room.join_event_listeners.includes(id)}
onToggleJoinEvents={
- working ? undefined : (next) => handleToggleJoinEvents(id, next)
+ working || !canWrite
+ ? undefined
+ : (next) => handleToggleJoinEvents(id, next)
}
onRemove={
- isFixedMembership || working
+ isFixedMembership || working || !canWrite
? undefined
: () => handleRemoveAgent(id)
}
@@ -874,7 +878,7 @@ function ParticipantsSection({
</Typography>
)}
</Stack>
- {!isFixedMembership && (
+ {!isFixedMembership && canWrite && (
<>
<Button
size="small"