Skip to content
代码片段 群组 项目
未验证 提交 1af60712 编辑于 作者: Joe Woodward's avatar Joe Woodward 提交者: GitLab
浏览文件

Add auth check to delete tag endpoint

Prior to this change the delete tag endpoint did not enforce protected
tag logic. Our protected tags UI only allows owners to delete tags which
are protected, however, our API allowed anyone who can push to attempt
to delete the tag. We were not exposed as the logic downstream would
reject the change during the tag_check phase, however, it meant that
users would see a 500 error instead of a nice 403 error.

This change adds a new policy for the Gitlab::Git::Tag model which
checks if the tag is currently protected.

If the tag is not protected we allow developers+ to delete them.
If the tag is protected we only allow owners to delete them.

Co-authored-by: @nav-j
Changelog: fixed
上级 f9cbb68a
No related branches found
No related tags found
加载中
加载中
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册