Changed ACL processing logic (partly reverted to the state before 8997582)