From 1338680ef142f9a33ee32a00b07c7d2ae658cb3a Mon Sep 17 00:00:00 2001 From: Instrumental Date: Fri, 12 Jul 2019 17:01:40 -0500 Subject: Adjust Agent for none K8s Issue-ID: AAF-857 Change-Id: Iae6ab3800376465deb69d735d1ab38c931b46688 Signed-off-by: Instrumental --- .../src/main/java/org/onap/aaf/auth/dao/cass/CredDAO.java | 10 ++++++++++ .../src/main/java/org/onap/aaf/auth/dao/hl/Function.java | 7 ++++++- .../src/main/java/org/onap/aaf/auth/dao/hl/Question.java | 4 ++-- 3 files changed, 18 insertions(+), 3 deletions(-) (limited to 'auth/auth-cass') diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/CredDAO.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/CredDAO.java index 37501967..d64cff29 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/CredDAO.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/cass/CredDAO.java @@ -265,6 +265,16 @@ public class CredDAO extends CassDAOImpl { hd.memo = memo ? String.format("%s by %s", override[0], hd.user) : (modified.name() + "d credential for " + data.id); + String spacer = ": "; + if(data.notes!=null) { + hd.memo+=spacer + data.notes; + spacer = ", "; + } + + if(data.tag!=null) { + hd.memo+=spacer + data.tag; + } + // Detail? if (modified==CRUD.delete) { try { diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java index 3fde5123..c59312c0 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Function.java @@ -628,7 +628,12 @@ public class Function { return Result.err(Status.ERR_DependencyExists, sb.toString()); } - if (move && (parent == null || parent.type == NsType.COMPANY.type)) { + if (move && parent == null) { + return Result + .err(Status.ERR_DependencyExists, + "Cannot move users, roles or permissions - parent is missing.\nDelete dependencies and try again"); + } + else if (move && parent.type == NsType.COMPANY.type) { return Result .err(Status.ERR_DependencyExists, "Cannot move users, roles or permissions to [%s].\nDelete dependencies and try again", diff --git a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Question.java b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Question.java index 3abad1a5..22b14cb4 100644 --- a/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Question.java +++ b/auth/auth-cass/src/main/java/org/onap/aaf/auth/dao/hl/Question.java @@ -1178,9 +1178,9 @@ public class Question { } public boolean isAdmin(AuthzTrans trans, String user, String ns) { - Date now = new Date(); Result> rur = userRoleDAO.read(trans, user,ns+DOT_ADMIN); if (rur.isOKhasData()) { + Date now = new Date(); for (UserRoleDAO.Data urdd : rur.value){ if (urdd.expires.after(now)) { return true; @@ -1192,8 +1192,8 @@ public class Question { public boolean isOwner(AuthzTrans trans, String user, String ns) { Result> rur = userRoleDAO.read(trans, user,ns+DOT_OWNER); - Date now = new Date(); if (rur.isOKhasData()) {for (UserRoleDAO.Data urdd : rur.value){ + Date now = new Date(); if (urdd.expires.after(now)) { return true; } -- cgit 1.2.3-korg