@Test public void initializeOwnerAuthorizationCreatesAdminAuthorization() throws Exception { User user = userWithId("testuserid"); permissionFetcher.initializeOwnerAuthorization(user,"testownerid", "testdatasetid"); verify(vreAuthorizationCrud).createAuthorization("testownerid__testdatasetid", user, "ADMIN"); }
@Override public void initializeOwnerAuthorization(User user, String ownerId, String dataSetId) throws AuthorizationCreationException { String vreId = createCombinedId(ownerId, dataSetId); try { vreAuthorizationCrud.createAuthorization(vreId, user, "ADMIN"); } catch (AuthorizationCreationException e) { LOG.error("Could not initialize VRE Authorization {}", vreId); LOG.error("Exception thrown", e); throw e; } }
BasicPermissionFetcher implements PermissionFetcher { @Override public void initializeOwnerAuthorization(User user, String ownerId, String dataSetId) throws AuthorizationCreationException { String vreId = createCombinedId(ownerId, dataSetId); try { vreAuthorizationCrud.createAuthorization(vreId, user, "ADMIN"); } catch (AuthorizationCreationException e) { LOG.error("Could not initialize VRE Authorization {}", vreId); LOG.error("Exception thrown", e); throw e; } } }
BasicPermissionFetcher implements PermissionFetcher { @Override public void initializeOwnerAuthorization(User user, String ownerId, String dataSetId) throws AuthorizationCreationException { String vreId = createCombinedId(ownerId, dataSetId); try { vreAuthorizationCrud.createAuthorization(vreId, user, "ADMIN"); } catch (AuthorizationCreationException e) { LOG.error("Could not initialize VRE Authorization {}", vreId); LOG.error("Exception thrown", e); throw e; } } BasicPermissionFetcher(VreAuthorizationCrud vreAuthorizationCrud, PermissionConfiguration permissionConfig); }
BasicPermissionFetcher implements PermissionFetcher { @Override public void initializeOwnerAuthorization(User user, String ownerId, String dataSetId) throws AuthorizationCreationException { String vreId = createCombinedId(ownerId, dataSetId); try { vreAuthorizationCrud.createAuthorization(vreId, user, "ADMIN"); } catch (AuthorizationCreationException e) { LOG.error("Could not initialize VRE Authorization {}", vreId); LOG.error("Exception thrown", e); throw e; } } BasicPermissionFetcher(VreAuthorizationCrud vreAuthorizationCrud, PermissionConfiguration permissionConfig); @Override Set<Permission> getPermissions(User user, DataSetMetaData dataSetMetadata); @Override boolean hasPermission(User user, DataSetMetaData dataSet, Permission permission); @Override @Deprecated Set<Permission> getOldPermissions(User user, String vreId); @Override void initializeOwnerAuthorization(User user, String ownerId, String dataSetId); @Override void removeAuthorizations(String vreId); }
BasicPermissionFetcher implements PermissionFetcher { @Override public void initializeOwnerAuthorization(User user, String ownerId, String dataSetId) throws AuthorizationCreationException { String vreId = createCombinedId(ownerId, dataSetId); try { vreAuthorizationCrud.createAuthorization(vreId, user, "ADMIN"); } catch (AuthorizationCreationException e) { LOG.error("Could not initialize VRE Authorization {}", vreId); LOG.error("Exception thrown", e); throw e; } } BasicPermissionFetcher(VreAuthorizationCrud vreAuthorizationCrud, PermissionConfiguration permissionConfig); @Override Set<Permission> getPermissions(User user, DataSetMetaData dataSetMetadata); @Override boolean hasPermission(User user, DataSetMetaData dataSet, Permission permission); @Override @Deprecated Set<Permission> getOldPermissions(User user, String vreId); @Override void initializeOwnerAuthorization(User user, String ownerId, String dataSetId); @Override void removeAuthorizations(String vreId);  }