implements AccessRule::module and fixes #4999