public Object getFieldValue(_Fields field) { switch (field) { case AUTHZ_OBJ: return getAuthzObj(); case ADD_PRIVILEGES: return getAddPrivileges(); case DEL_PRIVILEGES: return getDelPrivileges(); } throw new IllegalStateException(); }
private void applyPrivilegeUpdates(PermissionsUpdate update) { for (TPrivilegeChanges pUpdate : update.getPrivilegeUpdates()) { if (pUpdate.getAuthzObj().equals(PermissionsUpdate.RENAME_PRIVS)) { String newAuthzObj = pUpdate.getAddPrivileges().keySet().iterator().next(); String oldAuthzObj = pUpdate.getDelPrivileges().keySet().iterator().next(); if (pUpdate.getAuthzObj().equals(PermissionsUpdate.ALL_AUTHZ_OBJ)) { PrivilegeInfo pInfo = perms.getPrivilegeInfo(pUpdate.getAuthzObj()); for (Map.Entry<String, String> aMap : pUpdate.getAddPrivileges().entrySet()) { if (pInfo == null) { pInfo = new PrivilegeInfo(pUpdate.getAuthzObj()); perms.addParentChildMappings(pUpdate.getAuthzObj()); for (Map.Entry<String, String> dMap : pUpdate.getDelPrivileges().entrySet()) { if (dMap.getKey().equals(PermissionsUpdate.ALL_ROLES)) { perms.delPrivilegeInfo(pUpdate.getAuthzObj()); perms.removeParentChildMappings(pUpdate.getAuthzObj()); break;