예제 #1
0
  public void deleteUser(String user) 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));

    api.deleteUser(u.getUuid(), accountSession);
  }
예제 #2
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);
 }
예제 #3
0
 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);
 }
예제 #4
0
 public void attachPoliciesToUser(String user, List<String> puuids) 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));
   api.attachPolicesToUser(u.getUuid(), puuids, accountSession);
 }