* 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.
*/
public class ListByUser extends Cmd {
private static final String HEADER = "List Roles for User ";
-
+
public ListByUser(List parent) {
- super(parent,"user",
+ super(parent,"user",
new Param("id",true),
- new Param("detail", false));
+ new Param("detail", false));
}
@Override
public int _exec( int idx, final String ... args) throws CadiException, APIException, LocatorException {
final String user=fullID(args[idx]);
-
+
return same(new Retryable<Integer>() {
@Override
if (aafcli.isDetailed()) {
roles = new Roles();
Future<Perms> fp = client.read(
- "/authz/perms/user/"+user+"?ns&force",
+ "/authz/perms/user/"+user+"?ns&force",
getDF(Perms.class)
);
if (fp.get(AAFcli.timeout())) {
r.getPerms().add(p);
}
}
- }
+ }
code = fp.code();
} else {
roles = new Roles();
lr.add(r);
}
}
-
-
+
+
((List)parent).report(roles,perms,urs,HEADER,user);
return code;
}
});
}
-
+
@Override
public void detailedHelp(int indent, StringBuilder sb) {
detailLine(sb,indent,HEADER);