* 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.
/**
* Detail Page for Permissions
- *
+ *
* @author Jonathan
*
*/
/**
* Implement the table content for Permissions Detail
- *
+ *
* @author Jonathan
*
*/
final String pRole = trans.get(sRoleName, null);
Validator v = new Validator();
if(!v.isNull("Role",pRole).err()) {
- if(!pRole.startsWith(trans.user())) {
- v.role(pRole);
- }
+ if(!pRole.startsWith(trans.user())) {
+ v.role(pRole);
+ }
}
if (v.err()) {
trans.warn().printf("Error in PermDetail Request: %s", v.errs());
return;
}
-
- try {
+
+ try {
gui.clientAsUser(trans.getUserPrincipal(), new Retryable<Boolean>() {
@Override
public Boolean code(Rcli<?> client) throws CadiException, ConnectException, APIException {
trans.put(sMayWrite,mayWrite);
Boolean mayApprove = trans.fish(new AAFPermission(role.getNs(),ACCESS,":role:"+role.getName(),"approve"));
trans.put(sMayApprove, mayApprove);
-
+
if (mayWrite || mayApprove) {
Mark js = new Mark();
Mark fn = new Mark();
"dcb.checked= (d.orig != d.value)"
).end(fn)
.end(js);
-
+
Mark mark = new Mark();
hgen.incr(mark,"form","method=post");
trans.put(sMark, mark);
trans.error().printf("Error calling AAF for Roles in GUI, Role Detail %d: %s",fr.code(),fr.body());
return false;
}
-
+
if (fur.get(AAF_GUI.TIMEOUT)) {
trans.put(sUserRole, fur.value.getUserRole());
} else {
final String pRole = trans.get(sRoleName, null);
final Role role = trans.get(sRole,null);
ArrayList<AbsCell[]> rv = new ArrayList<>();
-
+
if (role!=null) {
boolean mayWrite = trans.get(sMayWrite, false);
boolean mayApprove = trans.get(sMayApprove, false);
}
}
}
-
+
if (mayApprove) {
rv.add(AbsCell.HLINE);
- //
+ //
rv.add(new AbsCell[] {
new TextCell("Users in Role:","width=25%"),
new TextCell("Delete","width=10%"),
if (userroles!=null) {
for (UserRole ur : userroles) {
String tag = "userrole";
-
+
rv.add(new AbsCell[] {
AbsCell.Null,
new CheckBoxCell(tag+".delete", ur.getUser()),
}
}
}
-
- // History
+
+ // History
rv.add(new AbsCell[] {
new RefCell("See History",RoleHistory.HREF + "?role=" + pRole,false,"class=greenbutton")
});
}
}
-}
+}
\ No newline at end of file