Search in sources :

Example 11 with Permission

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;
}
Also used : Permission(edu.uiuc.ncsa.myproxy.oa4mp.server.admin.permissions.Permission)

Example 12 with Permission

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;
}
Also used : Permission(edu.uiuc.ncsa.myproxy.oa4mp.server.admin.permissions.Permission)

Aggregations

Permission (edu.uiuc.ncsa.myproxy.oa4mp.server.admin.permissions.Permission)12 AdminClient (edu.uiuc.ncsa.myproxy.oa4mp.server.admin.adminClient.AdminClient)5 PermissionList (edu.uiuc.ncsa.myproxy.oa4mp.server.admin.permissions.PermissionList)4 Identifier (edu.uiuc.ncsa.security.core.Identifier)4 OA2Client (edu.uiuc.ncsa.security.oauth_2_0.OA2Client)4 TypePermission (edu.uiuc.ncsa.myproxy.oa4mp.server.admin.things.types.TypePermission)3 ActionList (edu.uiuc.ncsa.myproxy.oa4mp.server.admin.things.actions.ActionList)2 LinkedList (java.util.LinkedList)2 GeneralException (edu.uiuc.ncsa.security.core.exceptions.GeneralException)1 ClientApproval (edu.uiuc.ncsa.security.delegation.server.storage.ClientApproval)1