Skip to content

UN-2868 [FIX] Make settings read-only and block deletion on resources shared with a user - #2275

Draft
kirtimanmishrazipstack wants to merge 6 commits into
UN-2868-sharing-improvementsfrom
UN-2868-shared-read-only
Draft

UN-2868 [FIX] Make settings read-only and block deletion on resources shared with a user#2275
kirtimanmishrazipstack wants to merge 6 commits into
UN-2868-sharing-improvementsfrom
UN-2868-shared-read-only

Conversation

@kirtimanmishrazipstack

@kirtimanmishrazipstack kirtimanmishrazipstack commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

What

Makes "shared with you" mean read-only in the places that matter, consistently across every resource.

If a resource is shared with you, you can now see it, use it, and pass access on — but you cannot change its settings or delete it.

You cannot:

  • change adapter or connector settings — the screens holding credentials
  • change Prompt Studio settings (LLM profiles, custom data, grammar, pre/postamble)
  • delete any resource shared with you

You still can:

  • share it onward — to a group you belong to, or a user in your organisation
  • run and watch a shared pipeline, enable or disable it, manage its keys and notifications, clear its file history
  • edit, run and delete prompts in a shared Prompt Studio project — that is what it was shared for

Owners, co-owners and organization admins are unaffected.

Why

Follow-up to #2273, which fixed the four reported defects. The same gap existed on every other shareable resource: the backend refused the write, but the screen said nothing, so people filled in a form and lost the work.

The concern is credentials. Settings screens are where they live, which is why those are the hard line rather than every button.

How

  • New canEditResource(resource, sessionDetails) helper — the single definition of the rule, reading the is_owner flag the serializers already provide. useWorkflowCanEdit delegates to it; a matching usePromptStudioCanEdit reads the Prompt Studio store. A payload still in flight counts as editable so the owner is never shown a read-only flash.
  • All eight resources render their list through two shared widgets, so row actions are gated once each: ResourceTable (workflows, Prompt Studio, connectors, adapters, agentic projects, lookups) and CardActionBox (pipelines, API deployments). Edit and Delete are hidden; Share is not.
  • CustomToolSerializer now exposes is_owner. Only CustomToolListSerializer had it, so the Prompt Studio editor could not tell a shared user from an owner.
  • SettingsModal carries the read-only notice and renders its panels inert, covering every settings tab in one place.
  • Adapters and connectors need no detail-page change: their tables are isClickable={false}, so the now-hidden Edit pencil was the only route into the credential form.

Can this PR break any existing features. If yes, please list possible items. If no, please explain why.

  • Owners, co-owners and admins see no change anywhere.
  • Reading is untouched. So is sharing onward, and so is running a shared pipeline.
  • Prompt editing in a shared Prompt Studio project is deliberately untouched.
  • One deliberate strictness: hiding Edit on adapters and connectors also removes a shared user's only route to view those settings. Worth revisiting if viewing them turns out to matter — the fix would be to open the form read-only instead of hiding the entry point.

Database Migrations

  • None.

Env Config

  • None.

Relevant Docs

  • None.

Related Issues or PRs

Dependencies Versions

  • None.

Notes on Testing

Surface Shared user Owner / admin
Adapter, connector settings no entry point unchanged
Prompt Studio settings read-only notice, inert unchanged
Delete, on any resource hidden unchanged
Pipeline toggle, keys, notifications available unchanged
Share, on any resource available unchanged
Prompts in a shared project editable unchanged
Run / sync a shared pipeline available unchanged

Frontend build passes; biome clean. Not yet exercised by hand against a shared account — that is planned.

Screenshots

Checklist

I have read and understood the Contribution Guidelines.

🤖 Generated with Claude Code

https://claude.ai/code/session_016eB6bLmieWVwUnmYH6H5WZ

…he user

Sharing grants read only, but every resource list still offered Edit, Share,
Delete and the enable/disable toggle to the people it was shared with. The
backend refused them; the UI did not say so.

All eight shareable resources render through two shared widgets, so the row
actions are gated in one place each -- ResourceTable covers workflows, Prompt
Studio, connectors, adapters, agentic projects and lookups; CardActionBox
covers pipelines and API deployments.

The two card kebabs mix read and write actions, so those are filtered per
page: Manage Keys, Notifications and Clear File History go, while View Logs,
File History, Sync Now, Code Snippets and Download Postman stay. Running and
watching a shared pipeline is still allowed -- that is what sharing is for.

The rule itself now lives in one helper, canEditResource, which
useWorkflowCanEdit also delegates to.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016eB6bLmieWVwUnmYH6H5WZ
The Prompt Studio editor is served by CustomToolSerializer, which never
carried is_owner -- only the list serializer did. Without it the editor cannot
tell a shared user from an owner, so its edit controls cannot be gated.

canEditResource now treats a payload that has not arrived yet as editable.
The backend refuses the write either way, and the alternative flashes a
read-only view at the resource's own owner while the request is in flight.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016eB6bLmieWVwUnmYH6H5WZ
…d delete

Sharing onward is allowed for someone a resource was shared with: they may
pass access to a group they belong to, or to a user in the same organisation.
ShareAuthorizationService enforces both rules per axis, which is why the
share endpoint sits at IsOwnerOrSharedUserOrSharedToOrg rather than IsOwner.

The previous commit hid the Share button along with Edit and Delete. Only the
latter two should go.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016eB6bLmieWVwUnmYH6H5WZ
Settings hold the project's LLM profiles and adapter selections -- the
credential-bearing part. A shared user can read them but not change them: the
panel gets the read-only notice and its controls are inert.

Prompts are deliberately untouched. Editing, running and deleting prompts is
what a project is shared for; only the settings panel is restricted.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016eB6bLmieWVwUnmYH6H5WZ
The scope is settings and deletion, nothing else. The pipeline and API
deployment cards had also lost their enable/disable toggle, Manage Keys,
Notifications and Clear File History for shared users, which goes further
than intended.

Both card configs are reverted. Only the Edit and Delete controls in the two
shared list widgets stay gated; Share, the toggle and every kebab action are
available again.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016eB6bLmieWVwUnmYH6H5WZ
Hiding the two controls left a shared user with no idea they existed or why
they were missing. They now stay on screen, greyed out, with a tooltip
reading "Only the owner can change this". Same treatment in both list widgets
so every resource looks the same.

The rename pencil beside a project title follows the same rule: ToolNavBar
takes an editTitleDisabled prop, and Prompt Studio passes it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016eB6bLmieWVwUnmYH6H5WZ
@sonarqubecloud

sonarqubecloud Bot commented Sep 2, 2026

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant