refactoring: change condition for permissions