LOGGER.debug("got lock removing authorization to graph user %s", auth);
if (graph instanceof AccumuloGraph) {
try {
AccumuloGraph accumuloGraph = (AccumuloGraph) graph;
String principal = accumuloGraph.getConnector().whoami();
Authorizations currentAuthorizations = accumuloGraph.getConnector().securityOperations().getUserAuthorizations(principal);
if (!currentAuthorizations.toString().contains(auth)) {
return;
}
byte[] authBytes = auth.getBytes(Constants.UTF8);
List<byte[]> newAuthorizationsArray = new ArrayList<byte[]>();
for (byte[] currentAuth : currentAuthorizations) {
if (Arrays.equals(currentAuth, authBytes)) {
continue;
}
newAuthorizationsArray.add(currentAuth);
}
Authorizations newAuthorizations = new Authorizations(newAuthorizationsArray);
accumuloGraph.getConnector().securityOperations().changeUserAuthorizations(principal, newAuthorizations);
} catch (Exception ex) {
throw new RuntimeException("Could not update authorizations in accumulo", ex);
}
} else {