implements AccessRule::module and fixes #4999

It's not used anymore.