Change-Id: Ia5e8cbbdaa1a958f47fd14985dd762bba0065d5d
if (user.getTicket() == null) {
return false;
}
if (user.getTicket() == null) {
return false;
}
- if ((req.getParameter("detailupdate") != null ? 1 : 0) + (req.getParameter("grant") != null ? 1 : 0) + (req.getParameter("deny") != null ? 1 : 0) + (req.getParameter("resetPass") != null ? 1 : 0) != 1) {
+ if ((req.getParameter("detailupdate") != null ? 1 : 0) + (req.getParameter("addGroup") != null ? 1 : 0) + (req.getParameter("removeGroup") != null ? 1 : 0) + (req.getParameter("resetPass") != null ? 1 : 0) != 1) {
throw new GigiApiException("More than one action requested!");
}
throw new GigiApiException("More than one action requested!");
}
- if (req.getParameter("grant") != null || req.getParameter("deny") != null) {
+ if (req.getParameter("addGroup") != null || req.getParameter("removeGroup") != null) {
String actionType = "granted";
value.update(req);
Group toMod = value.getGroup();
String actionType = "granted";
value.update(req);
Group toMod = value.getGroup();
- if (req.getParameter("grant") != null) {
+ if (req.getParameter("addGroup") != null) {
user.grant(toMod);
} else {
actionType = "revoked";
user.grant(toMod);
} else {
actionType = "revoked";
<tr>
<td><?=_Support Managed Groups?>:</td>
<td><p><? foreach($support-groups) { ?><?=$group_concat?><?=$group?><? } ?></p>
<tr>
<td><?=_Support Managed Groups?>:</td>
<td><p><? foreach($support-groups) { ?><?=$group_concat?><?=$group?><? } ?></p>
- <p><?=$groupSelector?><input class="btn btn-info" type='submit' value='<?=_Grant Group?>' name='grant'> <input class="btn btn-info" type='submit' value='<?=_Deny Group?>' name='deny'></p>
+ <p><?=$groupSelector?><input class="btn btn-info" type='submit' value='<?=_Add Group?>' name='addGroup'> <input class="btn btn-info" type='submit' value='<?=_Remove Group?>' name='removeGroup'></p>
if ( !Form.getForm(req, SupportRevokeCertificatesForm.class).submit(resp.getWriter(), req)) {
throw new GigiApiException("No ticket number set.");
}
if ( !Form.getForm(req, SupportRevokeCertificatesForm.class).submit(resp.getWriter(), req)) {
throw new GigiApiException("No ticket number set.");
}
- } else if (req.getParameter("detailupdate") != null || req.getParameter("resetPass") != null || req.getParameter("deny") != null || req.getParameter("grant") != null) {
+ } else if (req.getParameter("detailupdate") != null || req.getParameter("resetPass") != null || req.getParameter("removeGroup") != null || req.getParameter("addGroup") != null) {
if ( !Form.getForm(req, SupportUserDetailsForm.class).submit(resp.getWriter(), req)) {
throw new GigiApiException("No ticket number set.");
}
if ( !Form.getForm(req, SupportUserDetailsForm.class).submit(resp.getWriter(), req)) {
throw new GigiApiException("No ticket number set.");
}
@Test
public void testGrantUserGroup() throws MalformedURLException, IOException {
@Test
public void testGrantUserGroup() throws MalformedURLException, IOException {
- executeBasicWebInteraction(cookie, SupportUserDetailsPage.PATH + targetID + "/", "grant&groupToModify=supporter", 0);
+ executeBasicWebInteraction(cookie, SupportUserDetailsPage.PATH + targetID + "/", "addGroup&groupToModify=supporter", 0);
String message = getMailReceiver().receive().getMessage();
assertThat(message, containsString("The group permission supporter was granted."));
String message = getMailReceiver().receive().getMessage();
assertThat(message, containsString("The group permission supporter was granted."));
@Test
public void testRemoveUserGroup() throws MalformedURLException, IOException {
@Test
public void testRemoveUserGroup() throws MalformedURLException, IOException {
- executeBasicWebInteraction(cookie, SupportUserDetailsPage.PATH + targetID + "/", "deny&groupToModify=supporter", 0);
+ executeBasicWebInteraction(cookie, SupportUserDetailsPage.PATH + targetID + "/", "removeGroup&groupToModify=supporter", 0);
String message = getMailReceiver().receive().getMessage();
assertThat(message, containsString("The group permission supporter was revoked."));
String message = getMailReceiver().receive().getMessage();
assertThat(message, containsString("The group permission supporter was revoked."));