[ENG-9074] fix(Add Community Metadata Button ): fix Add Community Metadata Button – Incorrect Visibility#582
Closed
mkovalua wants to merge 1 commit into
Closed
Conversation
…n – Incorrect Visibility
futa-ikeda
approved these changes
Oct 6, 2025
nsemets
requested changes
Oct 7, 2025
nsemets
left a comment
Collaborator
There was a problem hiding this comment.
We are working in files currently. It can cause conflicts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.