* added missing permissions check * moved the permission check to the datasource component. * added test for checking permissions. * added tests with different permissions. * minor refactoring so the mockUserPermisson can be reused.