public void deletePolicy(String policy) throws ApiSenderException { DebugUtils.Assert(account != null, "please call createAccount() before createPolicy()"); PolicyInventory p = policies.get(policy); DebugUtils.Assert(p != null, String.format("cannot find policy[%s]", policy)); api.deletePolicy(p.getUuid(), accountSession); }
public void detachPolicyFromGroup(String group, String policy) throws ApiSenderException { DebugUtils.Assert(account != null, "please call createAccount() before createPolicy()"); PolicyInventory p = policies.get(policy); DebugUtils.Assert(p != null, String.format("cannot find policy[%s]", policy)); UserGroupInventory g = groups.get(group); DebugUtils.Assert(g != null, String.format("cannot find group[%s]", group)); api.detachPolicyFromGroup(g.getUuid(), p.getUuid(), accountSession); }
public void detachPolicyFromUser(String user, String policy) throws ApiSenderException { DebugUtils.Assert(account != null, "please call createAccount() before createPolicy()"); UserInventory u = users.get(user); DebugUtils.Assert(u != null, String.format("cannot find user[%s]", user)); PolicyInventory p = policies.get(policy); DebugUtils.Assert(p != null, String.format("cannot find policy[%s]", policy)); api.detachPolicyFromUser(u.getUuid(), p.getUuid(), accountSession); }
public PolicyInventory createPolicy(String name, List<Statement> s) throws ApiSenderException { DebugUtils.Assert(account != null, "please call createAccount() before createPolicy()"); PolicyInventory p = api.createPolicy(name, s, accountSession); policies.put(p.getName(), p); return p; }