Please see my comments in the PR. It still doesn't work. This just brings the permission context to Java side.