Closed ballinette closed 8 years ago
NB: to fix that, we should replace the filter by
filter = { or: [{terms: { 'roles._id': [ role._id ] }}] };
... but as PR #332 is in review and is actually refactoring the repositories (especially the naming: roles
replaced by policies
), I suggest to wait for this PR to be merged before fixing this bug ;)
fixed in pr #332
Say we have a role test:
And a profile that uses this role:
If we try to delete the role, it is actually deleted, while we shouldn't be allowed to do it, as the role is still involved in a profile.
code to fix: https://github.com/kuzzleio/kuzzle/blob/develop/lib/api/core/models/repositories/roleRepository.js#L231 (probably the filter that doesn't work):