- public static void actuateDeletionNow(AuthzTrans trans, URDelete directDel) {
- for (UserRole ur : cache.getRemoved()) {
- directDel.exec(trans, ur, "Actuating UserRole Deletion");
+ public static void batchDelete(StringBuilder sb, List<String> row) {
+ sb.append("DELETE from authz.user_role WHERE user='");
+ sb.append(row.get(1));
+ sb.append("' AND role='");
+ sb.append(row.get(2));
+ sb.append("';\n");
+ }
+
+ public static void batchExtend(StringBuilder sb, List<String> row, Date newDate ) {
+ sb.append("UPDATE authz.user_role SET expires='");
+ sb.append(Chrono.dateTime(newDate));
+ sb.append("' WHERE user='");
+ sb.append(row.get(1));
+ sb.append("' AND role='");
+ sb.append(row.get(2));
+ sb.append("';\n");
+ }
+
+ public void batchExtend(StringBuilder sb, Date newDate) {
+ sb.append("UPDATE authz.user_role SET expires='");
+ sb.append(Chrono.dateTime(newDate));
+ sb.append("' WHERE user='");
+ sb.append(user());
+ sb.append("' AND role='");
+ sb.append(role());
+ sb.append("';\n");
+ }
+
+ public void batchUpdateExpires(StringBuilder sb) {
+ sb.append("UPDATE authz.user_role SET expires='");
+ sb.append(Chrono.dateTime(expires()));
+ sb.append("' WHERE user='");
+ sb.append(user());
+ sb.append("' AND role='");
+ sb.append(role());
+ sb.append("';\n");
+ }
+
+ public static String histMemo(String fmt, List<String> row) {
+ String reason;
+ if(row.size()>7) { // Reason included
+ reason = String.format("%s removed from %s because %s",
+ row.get(1),row.get(2),row.get(7));
+ } else {
+ reason = String.format(fmt, row.get(1),row.get(2), row.get(5));