Skip to content

[ENG-9074] fix(Add Community Metadata Button ): fix Add Community Metadata Button – Incorrect Visibility#582

Closed
mkovalua wants to merge 1 commit into
CenterForOpenScience:mainfrom
mkovalua:fix/ENG-9074
Closed

[ENG-9074] fix(Add Community Metadata Button ): fix Add Community Metadata Button – Incorrect Visibility#582
mkovalua wants to merge 1 commit into
CenterForOpenScience:mainfrom
mkovalua:fix/ENG-9074

Conversation

@mkovalua

@mkovalua mkovalua commented Oct 6, 2025

Copy link
Copy Markdown
Contributor

Purpose

Summary

The “Add Community Metadata” button is visible to all users, including unauthenticated visitors. This button should only display for contributors with write or admin permissions on a project.

Description

Currently, the “Add Community Metadata” button appears on project file pages even when the user is not logged in or lacks sufficient permissions.
This violates the intended access rules, where only write and admin contributors should see or interact with this button.

Observed Behavior:

The button is visible to unauthenticated users.

Clicking the button as a non-contributor leads to unintended UI exposure.

Expected Behavior:

The button should only render for authenticated users with write or admin contributor permissions.

The button should not appear for read-only contributors or non-contributors (The project must be public).

Summary of Changes

Check if user has write or admin access before rendering the button

Screen.Recording.2025-10-06.at.22.48.50.1.mov

Screenshot(s)

Side Effects

QA Notes

Navigate to https://test.osf.io/9e4zc/files/3xktc or staging4 (if it does not work for test.osf.io maybe it does not deploy at same time ) while not logged in.

Observe that the “Add Community Metadata” button is visible.

Log in as a read-only contributor — note that the button is still visible.

Log in as a write/admin contributor — the button functions correctly.

@mkovalua mkovalua marked this pull request as ready for review October 6, 2025 20:25

@nsemets nsemets left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We are working in files currently. It can cause conflicts.

@nsemets nsemets closed this Oct 9, 2025
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.

3 participants