Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

fix(show-page): align owner-only access controls

Max5c6a69743bea
diff --git a/tests/test_resource_acl_show_pages.py b/tests/test_resource_acl_show_pages.py
index 66354e705..b3a35ff50 100644
--- a/tests/test_resource_acl_show_pages.py
+++ b/tests/test_resource_acl_show_pages.py
@@ -561,6 +561,15 @@ def test_show_page_access_api_distinguishes_personal_and_organization_modes(monk
}
+def test_show_page_access_api_reports_missing_page_as_definitive_denial(monkeypatch, tmp_path) -> None:
+ monkeypatch.setenv("AVIBE_HOME", str(tmp_path))
+
+ response = app.test_client().get("/api/show-pages/ses-missing/access")
+
+ assert response.status_code == 404
+ assert response.get_json()["code"] == "show_page_not_found"
+
+
def test_show_page_owner_can_read_and_replace_exact_email_grants(monkeypatch, tmp_path) -> None:
monkeypatch.setenv("AVIBE_HOME", str(tmp_path))
store = ShowPageStore()
diff --git a/tests/test_ui_server_fastapi.py b/tests/test_ui_server_fastapi.py
index e4f2e1f0c..f4cf78606 100644
--- a/tests/test_ui_server_fastapi.py
+++ b/tests/test_ui_server_fastapi.py
@@ -555,6 +555,12 @@ def _machine_coded_error_builders():
"share_id_taken",
409,
),
+ (
+ "show_page_missing",
+ lambda: ui_server._show_page_error_response(_Coded("missing", "show_page_not_found")),
+ "show_page_not_found",
+ 404,
+ ),
("dock", lambda: ui_server._dock_error_response(_Coded("nope", "show_page_not_found")), "show_page_not_found", 404),
(
"show_page_icon",
diff --git a/ui/src/components/workbench/ShowPageWorkspaceAccessControl.test.tsx b/ui/src/components/workbench/ShowPageWorkspaceAccessControl.test.tsx
index 594f269d9..e324448ba 100644
--- a/ui/src/components/workbench/ShowPageWorkspaceAccessControl.test.tsx
+++ b/ui/src/components/workbench/ShowPageWorkspaceAccessControl.test.tsx
@@ -102,6 +102,12 @@ describe('ShowPageWorkspaceAccessControl', () => {
expect(html).not.toContain('chat.showPage.emailAccessDesc');
});
+ it('hides exact-email grants from an Organization admin who does not own the page', () => {
+ const html = renderControl(access({ can_manage: true, can_publish_public: false }));
+
+ expect(html).not.toContain('chat.showPage.emailAccess');
+ });
+
it('mounts the established Organization audience-narrowing confirmation', () => {
const html = renderControl(access({ access_level: 'public' }));
diff --git a/ui/src/components/workbench/ShowPageWorkspaceAccessControl.tsx b/ui/src/components/workbench/ShowPageWorkspaceAccessControl.tsx
index a9b2e584c..5d0a9d1cd 100644
--- a/ui/src/components/workbench/ShowPageWorkspaceAccessControl.tsx
+++ b/ui/src/components/workbench/ShowPageWorkspaceAccessControl.tsx
@@ -435,7 +435,7 @@ export function ShowPageWorkspaceAccessControl({
{access ? (
<ShowPageEmailAccessEditor
active={active}
- canManage={canManage}
+ canManage={access.can_publish_public}
sessionId={sessionId}
/>
) : null}
diff --git a/vibe/ui_server.py b/vibe/ui_server.py
index f61ca4d11..68ef23589 100644
--- a/vibe/ui_server.py
+++ b/vibe/ui_server.py
@@ -4733,6 +4733,8 @@ def _show_page_error_response(exc):
code = getattr(exc, "code", "invalid_show_page_request")
if code == "resource_access_forbidden":
status = 403
+ elif code == "show_page_not_found":
+ status = 404
# A conflict (not a malformed request) when the page is in the wrong state or
# the chosen suffix is already claimed.
elif code in {"not_public", "share_id_taken"}: