use of edu.uiuc.ncsa.myproxy.oa4mp.server.admin.permissions.Permission in project OA4MP by ncsa.
the class OA2PermissionCommands method format.
@Override
protected String format(Identifiable identifiable) {
Permission p = (Permission) identifiable;
String output = "Permission: admin=" + p.getAdminID() + ", client=" + p.getClientID() + ", id=" + p.getIdentifierString();
return output;
}
use of edu.uiuc.ncsa.myproxy.oa4mp.server.admin.permissions.Permission in project OA4MP by ncsa.
the class OA2PermissionCommands method update.
@Override
public boolean update(Identifiable identifiable) {
Permission p = (Permission) identifiable;
String input;
if (p.getClientID() == null) {
input = getInput("Enter new client id", "");
} else {
input = getInput("Enter new client id", p.getClientID().toString());
}
if (!isEmpty(input)) {
p.setClientID(BasicIdentifier.newID(input));
}
if (p.getAdminID() == null) {
input = getInput("Enter new admin id", "");
} else {
input = getInput("Enter new admin id", p.getAdminID().toString());
}
if (!isEmpty(input)) {
p.setAdminID(BasicIdentifier.newID(input));
}
input = getInput("set all permissions (y/n):", "y");
if (!isEmpty(input)) {
if (input.toLowerCase().equals("y")) {
p.setApprove(true);
p.setCreate(true);
p.setDelete(true);
p.setRead(true);
p.setWrite(true);
} else {
p.setApprove(false);
p.setCreate(false);
p.setDelete(false);
p.setRead(false);
p.setWrite(false);
}
}
return false;
}
Aggregations