When deactivating a user, permission template permission are not deleted in database, whereas permissions and other related data are deleted.
What needs to be done:
- migrate existing data
- delete user template permissions when deactivating a user – WS api/users/deactivate
It doesn't matter if the user is the last permission in the template.