Fix GUI Role window
[aaf/authz.git] / auth / auth-service / src / main / java / org / onap / aaf / auth / service / AuthzCassServiceImpl.java
index fa09911..519721c 100644 (file)
@@ -214,7 +214,7 @@ public class AuthzCassServiceImpl   <NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS
                        expectedCode = 201,
                        errorCodes = { 403,404,406,409 }, 
                        text = {        "Add an Identity :id to the list of Admins for the Namespace :ns", 
-                                               "Note: :id must be fully qualified (i.e. ab1234@csp.att.com)" }
+                                               "Note: :id must be fully qualified (i.e. ab1234@people.osaaf.org)" }
                        )
        @Override
        public Result<Void> addAdminNS(AuthzTrans trans, String ns, String id) {
@@ -230,7 +230,7 @@ public class AuthzCassServiceImpl   <NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS
                        expectedCode = 200,
                        errorCodes = { 403,404 }, 
                        text = {        "Remove an Identity :id from the list of Admins for the Namespace :ns",
-                                               "Note: :id must be fully qualified (i.e. ab1234@csp.att.com)" }
+                                               "Note: :id must be fully qualified (i.e. ab1234@people.osaaf.org)" }
                        )
        @Override
        public Result<Void> delAdminNS(AuthzTrans trans, String ns, String id) {
@@ -246,7 +246,7 @@ public class AuthzCassServiceImpl   <NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS
                        expectedCode = 201,
                        errorCodes = { 403,404,406,409 }, 
                        text = {        "Add an Identity :id to the list of Responsibles for the Namespace :ns",
-                                               "Note: :id must be fully qualified (i.e. ab1234@csp.att.com)" }
+                                               "Note: :id must be fully qualified (i.e. ab1234@people.osaaf.org)" }
                        )
        @Override
        public Result<Void> addResponsibleNS(AuthzTrans trans, String ns, String id) {
@@ -262,7 +262,7 @@ public class AuthzCassServiceImpl   <NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS
                        expectedCode = 200,
                        errorCodes = { 403,404 }, 
                        text = {        "Remove an Identity :id to the list of Responsibles for the Namespace :ns",
-                                               "Note: :id must be fully qualified (i.e. ab1234@csp.att.com)",
+                                               "Note: :id must be fully qualified (i.e. ab1234@people.osaaf.org)",
                                                "Note: A namespace must have at least 1 responsible party"
                                        }
                        )
@@ -512,7 +512,7 @@ public class AuthzCassServiceImpl   <NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS
                        expectedCode = 200,
                        errorCodes = { 403,404 }, 
                        text = {        "Lists all Namespaces where Identity :id is an Admin", 
-                                               "Note: :id must be fully qualified (i.e. ab1234@csp.att.com)" 
+                                               "Note: :id must be fully qualified (i.e. ab1234@people.osaaf.org)" 
                                        }
                        )
        @Override
@@ -542,7 +542,7 @@ public class AuthzCassServiceImpl   <NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS
                        expectedCode = 200,
                        errorCodes = { 403,404 }, 
                        text = {        "Lists all Namespaces where Identity :id is either an Admin or an Owner", 
-                                               "Note: :id must be fully qualified (i.e. ab1234@csp.att.com)" 
+                                               "Note: :id must be fully qualified (i.e. ab1234@people.osaaf.org)" 
                                        }
                        )
        @Override
@@ -633,7 +633,7 @@ public class AuthzCassServiceImpl   <NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS
                        expectedCode = 200,
                        errorCodes = { 403,404 }, 
                        text = {        "Lists all Namespaces where Identity :id is a Responsible Party", 
-                                               "Note: :id must be fully qualified (i.e. ab1234@csp.att.com)"
+                                               "Note: :id must be fully qualified (i.e. ab1234@people.osaaf.org)"
                                        }
                        )
        @Override
@@ -1574,7 +1574,8 @@ public class AuthzCassServiceImpl <NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS
                }
                
                // Look up data
-               Result<List<RoleDAO.Data>> rlrd = ques.getRolesByName(trans, role);
+               int query = role.indexOf('?');
+               Result<List<RoleDAO.Data>> rlrd = ques.getRolesByName(trans, query<0?role:role.substring(0, query));
                if(rlrd.isOK()) {
                        // Note: Mapper will restrict what can be viewed
                        ROLES roles = mapper.newInstance(API.ROLES);
@@ -1739,7 +1740,7 @@ public class AuthzCassServiceImpl <NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS
        @Override
        public Result<ROLES> getRolesByPerm(AuthzTrans trans, String type, String instance, String action) {
                final Validator v = new ServiceValidator();
-               if(v.permType(type,null)
+               if(v.permType(type)
                        .permInstance(instance)
                        .permAction(action)
                        .err()) {
@@ -2258,7 +2259,7 @@ public class AuthzCassServiceImpl <NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS
 
        }
 
-       private final long DAY_IN_MILLIS = 24*3600*1000;
+       private final long DAY_IN_MILLIS = 24*3600*1000L;
        
        @ApiDoc( 
                        method = POST,  
@@ -2913,6 +2914,9 @@ public class AuthzCassServiceImpl <NSS,PERMS,PERMKEY,ROLES,USERS,USERROLES,DELGS
                                                }
                                        }
                                }
+                               if(udr==null) {
+                                       return Result.err(Result.ERR_NotFound,"No User Data found");
+                               }
                                if (udr.isOK()) {
                                        return Result.ok();
                                }