* 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.
import aaf.v2_0.RolePermRequest;
/**
- *
+ *
* @author Jonathan
*
*/
new Param("instance",true),
new Param("action",true),
new Param("role[,role]*",false)
- );
+ );
}
@Override
int idx = index;
String action = args[idx++];
int option = whichOption(options, action);
-
+
RolePermRequest rpr = new RolePermRequest();
Pkey pk = new Pkey();
pk.setType(args[idx++]);
pk.setAction(args[idx++]);
rpr.setPerm(pk);
setStartEnd(rpr);
-
+
Future<RolePermRequest> frpr = null;
-
- String[] roles = args[idx++].split(",");
+
+ String[] roles = args[idx].split(",");
String strA;
String strB;
for (String role : roles) {
// You can request to Grant Permission to a Role
setQueryParamsOn(client);
frpr = client.create(
- "/authz/role/perm",
+ "/authz/role/perm",
getDF(RolePermRequest.class),
rpr
);
// You can request to UnGrant Permission to a Role
setQueryParamsOn(client);
frpr = client.delete(
- "/authz/role/" + role + "/perm",
+ "/authz/role/" + role + "/perm",
getDF(RolePermRequest.class),
rpr
);
strB = "] from Role [";
}
if (frpr.get(AAFcli.timeout())) {
- pw().println(strA + pk.getType() + '|' + pk.getInstance() + '|' + pk.getAction()
+ pw().println(strA + pk.getType() + '|' + pk.getInstance() + '|' + pk.getAction()
+ strB + role +']');
} else {
if (frpr.code()==202) {
pw().println(" Accepted, but requires Approvals before actualizing");
} else {
error(frpr);
- idx=Integer.MAX_VALUE;
- }
+ }
}
}
return frpr==null?0:frpr.code();