Repository navigation
fix(cve5): hide the local delete link from non-security users - #309
Open
Anurag-S1ngh wants to merge 1 commit into
Open
Anurag-S1ngh wants to merge 1 commit into
Anurag-S1ngh wants to merge 1 commit into
Conversation
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.
Summary
The CVE editor showed "Delete this entry from local Vulnogram database" to everyone, but the delete route only allows users in the
securitygroup. For PMC members the button opens a confirmation dialog, then the request is refused and the page still reports the entry as deleted.This hides the action from users who cannot perform it, which is what #13 settled on when it was closed, and keeps it for the security team.
Changes
custom/cve5/edit.pug: hide#removefor users whosepmcsdo not includesecurity.Kept in the ASF custom template so the shared editor view and the exported JavaScript stay untouched and upstream merges do not conflict.
Testing
securityuser: the delete link is present.tomcat): the link is hidden.VULNOGRAM_TLS_CERT=unittest/cert.pem VULNOGRAM_TLS_KEY=unittest/key.pem npm run unittestpasses.Closes #307