Skip to content

fix(cve5): hide the local delete link from non-security users - #309

Open
Anurag-S1ngh wants to merge 1 commit into
apache:mainfrom
Anurag-S1ngh:fix/307-hide-delete-entry-link
Open

Anurag-S1ngh wants to merge 1 commit into
apache:mainfrom
Anurag-S1ngh:fix/307-hide-delete-entry-link

Conversation

@Anurag-S1ngh

Copy link
Copy Markdown

Summary

The CVE editor showed "Delete this entry from local Vulnogram database" to everyone, but the delete route only allows users in the security group. 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 #remove for users whose pmcs do not include security.

Kept in the ASF custom template so the shared editor view and the exported JavaScript stay untouched and upstream merges do not conflict.

Testing

  • Rendered the editor as a security user: the delete link is present.
  • Rendered the editor as a PMC user (tomcat): the link is hidden.
  • VULNOGRAM_TLS_CERT=unittest/cert.pem VULNOGRAM_TLS_KEY=unittest/key.pem npm run unittest passes.

Closes #307

@raboof raboof left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

neat!

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.

remove/disable "Delete this entry from local Vulnogram database"

2 participants