In the advent of BZ 63636 it turned out that role mappings aren't accessible to a realm via a wrapper because they are never passed in RealmBase#hasResourcePermission(). Moreover, security references aren't available either. A PR is in preparation.
Fixed in: - master for 9.0.25 onwards - 8.5.x for 8.5.46 onwards - 7.0.x for 7.0.97 onwards