Remove Tabs, per Jococo
[aaf/authz.git] / auth / auth-cass / src / main / java / org / onap / aaf / auth / dao / hl / Function.java
index 3fde512..dd367c5 100644 (file)
@@ -245,13 +245,13 @@ public class Function {
         
         // 2.1) Does role exist with that name
         if(cname!=null && q.roleDAO().read(trans, parent, cname).isOKhasData()) {
-               return Result.err(Status.ERR_ConflictAlreadyExists,
+            return Result.err(Status.ERR_ConflictAlreadyExists,
                     "Role exists with that name");
         }
 
         // 2.2) Do perms exist with that name
         if(cname!=null && q.permDAO().readByType(trans, parent, cname).isOKhasData()) {
-               return Result.err(Status.ERR_ConflictAlreadyExists,
+            return Result.err(Status.ERR_ConflictAlreadyExists,
                     "Perms exist with that name");
         }
 
@@ -1035,7 +1035,7 @@ public class Function {
 
         // Attached to any Roles?
         if (fullperm.roles != null) {
-            if (force) {
+            if (force || fullperm.roles.contains(user+":user")) {
                 for (String role : fullperm.roles) {
                     Result<Void> rv = null;
                     Result<RoleDAO.Data> rrdd = RoleDAO.Data.decode(trans, q, role);