Log.out.debug("Begin CustomerAccount.grantAdmin("+oUsr.getEmail()+")");
AuthorizationAdminManager oAam = oSes.getAuthorizationAdminManager();
AdminGroupRights oAll = AdminRightsFactory.getGroupRightsAllGrant();
String sBusinessName = getString("business_name");
AdministeredUser oAsr = oUsr.getAdministeredUser();
AdministeredGroup oAdm = oAam.getGroup(sBusinessName+" administrators");
if (!oAdm.getMembers().contains(oAsr)) {
oAdm.addMember(oAsr);
oAam.setRights(oAsr, oAdm, oAll);
}
AdministeredGroup oStd = oAam.getGroup(sBusinessName+" standard users");
if (oStd.getMembers().contains(oAsr))
oStd.removeMember(oAsr);
oAam.setRights(oAsr, oStd, oAll);
AdministeredGroup oGts = oAam.getGroup(sBusinessName+" guests");
if (oGts.getMembers().contains(oAsr))
oGts.removeMember(oAsr);
oAam.setRights(oAsr, oGts, oAll);
AdministeredGroup oZus = oAam.getGroup("Zesped Users");
if (!oZus.getMembers().contains(oUsr.getAdministeredUser())) {
oZus.addMember(oUsr.getAdministeredUser());
oAam.setRights(oAsr, oZus, oAll);
}
Log.out.debug("End CustomerAccount.grantAdmin("+oUsr.getEmail()+")");
}