core-5105 fix varies permission and sorting on permission