Skip to content

fix: display "Unflag package" to users who initiated the flag

Kevin Morris requested to merge kevr/aurweb:fix-user-unflag into master

The original change which fixed another issue by introduced this inconsistency was located in !488 (merged)

What happened was:

  1. Before !488 (merged), the "Unflag package" link was incorrectly shown to all users, even if they couldn't use it. So, users without authority were able to click the link which led them to a bad response.
  2. !488 (merged) solved 1 by only displaying that link for co-maintiainers and maintainers in particular.
  3. With 2, this also removed the "Unflag package" link for the user who initiated the flag on a package.
  4. With this commit, we restore the ability for users who initiated a flag to view the "Unflag package" link, while keeping it hidden for other users which have nothing to do with the package (in terms of flag state).

As of now, the following can both view and use "Unflag package":

  • Maintainer of the package
  • Co-maintainers of the package
  • User who flagged the package

While all other users would be able to see the flag comment, but not perform anything having to do with unflagging the package.

Closes #380 (closed)

Signed-off-by: Kevin Morris kevr@0cost.org

Edited by Kevin Morris

Merge request reports

Loading