Move permission tracking into ShadowApplication.
Add @Implementation to ShadowApplication.checkPermission()