Copied from files from the same directory.
Wrapping at the PermissionsProvider level instead, which removes some code duplication and fixes 2 warnings :)