Improve Protected Tag deletion error message
Summary
As of writing, Protected tags documentation states that only maintainers and owners can delete a tag which is protected. However, in reality this is not the case. We have some conflicting logic, the UI allows maintainers+ to delete the tag, however, the pre-receive hooks check if the user is allowed to create the tag so we end up in a situation where users that shouldn't be allowed to delete can attempt to and then receive a 500.
Screenshots
Add a user and No one to the Allowed to create config
When a maintainer that is not in this list tries to delete the protected tag they see a 500 error message.
Steps to Reproduce
- User A (Maintainer or Owner) creates
Protected Tagnamedv1.0.0and setsAllowed to createRole toNo one. - User B (Maintainer) deletes the protected tag
v1.0.0in the UI by following the steps here. - Receive 500 error.
Proposal
- Update the UI logic hiding the
delete tagbutton to check if the current user is allowed to create. - Update the policy used in the tags API to check if the current user is allowed to create.
- Update the policy used in the tags controller to check if the current user is allowed to create.
- Update the documentation to reflect this correctly.
- Update the naming of the
Allowed to createfield toAllowed to create and delete
Is this a breaking change?
The documentation has been incorrect for 7 years. I would argue this isn't a breaking change as the pre-receive hook has always rejected these deletions. This is fixing a bug in the UX.

