Beispiel #1
0
 public void removeUserFromGroup(String user, String group) throws ApiSenderException {
   DebugUtils.Assert(account != null, "please call createAccount() before createPolicy()");
   UserInventory u = users.get(user);
   UserGroupInventory g = groups.get(group);
   DebugUtils.Assert(u != null, String.format("cannot find user[%s]", user));
   DebugUtils.Assert(g != null, String.format("cannot find group[%s]", group));
   api.removeUserFromGroup(u.getUuid(), g.getUuid(), accountSession);
 }
Beispiel #2
0
 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);
 }
Beispiel #3
0
 public void deleteGroup(String group) throws ApiSenderException {
   DebugUtils.Assert(account != null, "please call createAccount() before createPolicy()");
   UserGroupInventory g = groups.get(group);
   DebugUtils.Assert(g != null, String.format("cannot find group[%s]", group));
   api.deleteGroup(g.getUuid(), accountSession);
 }