@Test public void removeAuthorizationsRemovesAdminAuthorization() throws Exception { given(userValidator.getUserFromPersistentId("testownerid")).willReturn(Optional.of(testUser)); permissionFetcher.removeAuthorizations("testownerid__testdatasetid"); verify(vreAuthorizationCrud).deleteVreAuthorizations("testownerid__testdatasetid"); }
@Override public void removeAuthorizations(String vreId) throws PermissionFetchingException { try { vreAuthorizationCrud.deleteVreAuthorizations(vreId); } catch (AuthorizationUnavailableException e) { throw new PermissionFetchingException(String.format("Delete of authorizations failed for '%s'.", vreId)); } }
BasicPermissionFetcher implements PermissionFetcher { @Override public void removeAuthorizations(String vreId) throws PermissionFetchingException { try { vreAuthorizationCrud.deleteVreAuthorizations(vreId); } catch (AuthorizationUnavailableException e) { throw new PermissionFetchingException(String.format("Delete of authorizations failed for '%s'.", vreId)); } } }
BasicPermissionFetcher implements PermissionFetcher { @Override public void removeAuthorizations(String vreId) throws PermissionFetchingException { try { vreAuthorizationCrud.deleteVreAuthorizations(vreId); } catch (AuthorizationUnavailableException e) { throw new PermissionFetchingException(String.format("Delete of authorizations failed for '%s'.", vreId)); } } BasicPermissionFetcher(VreAuthorizationCrud vreAuthorizationCrud, PermissionConfiguration permissionConfig); }
BasicPermissionFetcher implements PermissionFetcher { @Override public void removeAuthorizations(String vreId) throws PermissionFetchingException { try { vreAuthorizationCrud.deleteVreAuthorizations(vreId); } catch (AuthorizationUnavailableException e) { throw new PermissionFetchingException(String.format("Delete of authorizations failed for '%s'.", vreId)); } } 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 removeAuthorizations(String vreId) throws PermissionFetchingException { try { vreAuthorizationCrud.deleteVreAuthorizations(vreId); } catch (AuthorizationUnavailableException e) { throw new PermissionFetchingException(String.format("Delete of authorizations failed for '%s'.", vreId)); } } 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);  }