changed to unmaintained
[aaf/authz.git] / auth / auth-gui / src / main / java / org / onap / aaf / auth / gui / pages / PermDetail.java
index 750f725..00bec4c 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -53,7 +53,7 @@ import aaf.v2_0.Perms;
 
 /**
  * Detail Page for Permissions
- * 
+ *
  * @author Jonathan
  *
  */
@@ -71,7 +71,7 @@ public class PermDetail extends Page {
 
     /**
      * Implement the table content for Permissions Detail
-     * 
+     *
      * @author Jonathan
      *
      */
@@ -88,11 +88,11 @@ public class PermDetail extends Page {
             final String pInstance = trans.get(instance, null);
             final String pAction = trans.get(action, null);
             Validator v = new Validator();
-            v.permType(pType)
+            v.permTypeWithUser(trans.user(),pType)
              .permInstance(pInstance)
              .permAction(pAction);
-            
-            if(v.err()) {
+
+            if (v.err()) {
                 trans.warn().printf("Error in PermDetail Request: %s", v.errs());
                 return Cells.EMPTY;
             }
@@ -107,18 +107,18 @@ public class PermDetail extends Page {
                         TimeTaken tt = trans.start("AAF Perm Details",Env.REMOTE);
                         try {
                             Future<Perms> fp= client.read("/authz/perms/"+pType + '/' + pInstance + '/' + pAction,gui.getDF(Perms.class));
-                    
-                            if(fp.get(AAF_GUI.TIMEOUT)) {
+
+                            if (fp.get(AAF_GUI.TIMEOUT)) {
                                 tt.done();
                                 tt = trans.start("Load Data", Env.SUB);
                                 List<Perm> ps = fp.value.getPerm();
-                                if(!ps.isEmpty()) {
+                                if (!ps.isEmpty()) {
                                     Perm perm = fp.value.getPerm().get(0);
                                     String desc = (perm.getDescription()!=null?perm.getDescription():BLANK);
                                     rv.add(new AbsCell[]{new TextCell("Description:"),new TextCell(desc)});
                                     boolean first=true;
-                                    for(String r : perm.getRoles()) {
-                                        if(first){
+                                    for (String r : perm.getRoles()) {
+                                        if (first){
                                             first=false;
                                             rv.add(new AbsCell[] {
                                                     new TextCell("Associated Roles:"),
@@ -132,10 +132,10 @@ public class PermDetail extends Page {
                                         }
                                     }
                                 }
-                                String historyLink = PermHistory.HREF 
+                                String historyLink = PermHistory.HREF
                                         + "?type=" + pType + "&instance=" + pInstance + "&action=" + pAction;
-                                
-                                rv.add(new AbsCell[] {new RefCell("See History",historyLink,false)});
+
+                                rv.add(new AbsCell[] {new RefCell("See History",historyLink,false,"class=greenbutton")});
                             } else {
                                 rv.add(new AbsCell[] {new TextCell(
                                     fp.code()==HttpStatus.NOT_FOUND_404?
@@ -156,5 +156,5 @@ public class PermDetail extends Page {
             return new Cells(rv,null);
         }
     }
-}        
+}
         
\ No newline at end of file