Skip to content

[OPIK-4714] [FE] Edit dataset permission#5722

Open
anastasiapyzhik wants to merge 9 commits intomainfrom
nastassia/OPIK-4714/edit-dataset-permission
Open

[OPIK-4714] [FE] Edit dataset permission#5722
anastasiapyzhik wants to merge 9 commits intomainfrom
nastassia/OPIK-4714/edit-dataset-permission

Conversation

@anastasiapyzhik
Copy link
Contributor

@anastasiapyzhik anastasiapyzhik commented Mar 18, 2026

Details

Add a new canEditDatasets permission to control edit-level access to datasets and evaluation suites in the frontend. This separates "edit" actions (add/edit items, expand with AI, manage tags, edit dataset metadata) from "delete" actions, enabling more granular role-based access control.

Changes:

  • Introduced DATASET_EDIT management permission and wired it through the permissions provider
  • Conditionally hide edit-related UI elements (add item, edit, expand with AI, manage tags, row click to edit, version history actions) based on canEditDatasets
  • Conditionally hide the actions column when no actions are available to the user
  • Adjusted tag rendering to show immutable tags when user lacks edit permission
  • Made the download action always visible (no longer gated behind showDownload prop)
  • Added separator between menu items only when both edit/download and delete actions are visible

Change checklist

  • New canEditDatasets permission added to Permissions type and defaults
  • DATASET_EDIT enum value added to ManagementPermissionsNames
  • Permission wired through useUserPermission hook and PermissionsProvider
  • DatasetItemsActionsPanel — hides "Expand with AI", tag management, and delete buttons
  • DatasetRowActionsCell — hides "Edit" menu item, removes showDownload prop
  • VersionHistoryTab — hides actions column when user cannot edit
  • EvaluationSuiteItemsPage — tags rendered as immutable when user cannot edit
  • EvaluationSuiteItemsTab — hides add item button, row actions, disables row click
  • EvaluationSuitesPage — hides actions column when no actions available

Screenshots

Screenshot 2026-03-20 at 15 32 08 Screenshot 2026-03-20 at 15 32 46 Screenshot 2026-03-20 at 15 33 03

Testing

  • Verify that users with dataset_edit permission can see all edit actions (add, edit, expand, tags, delete items)
  • Verify that users without dataset_edit permission cannot see edit-related actions but can still view datasets and export
  • Verify that the actions column is hidden when the user has no available actions
  • Verify that tags are shown as immutable (read-only) for users without edit permission
  • Verify default permissions (OSS mode) still allow full access

Issues

OPIK-4714

Documentation

N/A

@anastasiapyzhik anastasiapyzhik marked this pull request as ready for review March 18, 2026 15:34
@anastasiapyzhik anastasiapyzhik requested a review from a team as a code owner March 18, 2026 15:34
Copy link
Collaborator

@aadereiko aadereiko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this PR can't be merged as there is an enrormous PR with dataset changes coming from Yaroslav #5367

@anastasiapyzhik anastasiapyzhik marked this pull request as draft March 20, 2026 12:24
@anastasiapyzhik anastasiapyzhik marked this pull request as ready for review March 20, 2026 14:38
Copy link
Collaborator

@aadereiko aadereiko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code LGTM :) Good work!

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants