Bugfix: permissions of a role with duplicate ID

We remove the redundant permissions of a role with duplicate ID.

https://github.com/owncloud/ocis/pull/7976
https://github.com/owncloud/ocis/issues/7931
