modernize(tags): bulk delete tags api [#32970]
Proposed Changes
- Add deleteTags(String... tagIds) method to TagAPI interface
- Implement batch deletion using DotConnect.executeBatch() for performance
- Update REST endpoint to accept JSON body with tagIds array instead of path parameter
- Add comprehensive Postman tests for bulk delete
resolves: #32970
This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.
Guys, I removed from queue because I wanted to talk about permissions on this endpoint - unless I am mistaken, deleting tags is very much like changing content, especially as some of our tags have business meaning. It does not look like this API requires any permissions to do a bulk delete of tags.
Yes we currently only verify user authentication, which is in line with the existing single delete tag endpoint. We are considering Tags as metadata, not content. Deleting a tag doesn't modify contentlet data, but it does remove associations
Possible Approach: Before deleting a tag, verify the user has EDIT permission on associated content. This treats tags as metadata but respects content permissions.
Example logic:
- Tag has 0 associations: Delete allowed (orphan tag, no content affected)
- Tag has associations: Check if user has EDIT permission on ALL associated contentlets
- User has permission on all: Delete allowed
- User lacks permission on any associated content: Delete denied for that tag
Thoughts?
Yes we currently only verify user authentication, which is in line with the existing single delete tag endpoint. We are considering Tags as metadata, not content. Deleting a tag doesn't modify contentlet data, but it does remove associations ...
I like the idea. Just one doubt, what happens if the user doesn't have permission and in the bulk request are orphan and non-orphan tags?
Should the delete operation proceed only with the orphans and return the non eliminated because of the lack of permissions or should all fail?
Yes we currently only verify user authentication, which is in line with the existing single delete tag endpoint. We are considering Tags as metadata, not content. Deleting a tag doesn't modify contentlet data, but it does remove associations ...
I like the idea. Just one doubt, what happens if the user doesn't have permission and in the bulk request are orphan and non-orphan tags?
Should the delete operation proceed only with the orphans and return the non eliminated because of the lack of permissions or should all fail?
yes, you are correct. Orphan tags are deleted, non-permitted tags fail with errors in the response.