use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class TestAccess method createFolderAndReturnFolderId.
private String createFolderAndReturnFolderId(Role role, Perm perm) throws Exception {
String folderName = "/folder-" + random();
XMLElement req = new XMLElement(MailConstants.CREATE_FOLDER_REQUEST);
Element folder = req.addElement(MailConstants.E_FOLDER);
folder.addAttribute(MailConstants.A_NAME, folderName);
Element response = accessTest(role, perm, req);
if (response == null) {
// to validate that the next Create/ModifyDataSource call will get PERM_DENIED
return "1000";
} else
return response.getElement(MailConstants.E_FOLDER).getAttribute(MailConstants.A_ID);
}
use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class TestAccess method ModifyDataSource.
public void ModifyDataSource(Role role, Perm perm) throws Exception {
String dateSourceName = "datasource-modify-" + random();
DataSource ds = mProvAdmin.setup_createDataSource(this, role, perm, ACCT_1_EMAIL, dateSourceName);
XMLElement req = new XMLElement(MailConstants.MODIFY_DATA_SOURCE_REQUEST);
Element dataSource = req.addElement(MailConstants.E_DS_POP3);
dataSource.addAttribute(MailConstants.A_ID, ds.getId());
dataSource.addAttribute(MailConstants.A_DS_IS_ENABLED, "false");
accessTest(role, perm, req);
}
use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class TestAccess method ModifyProperties.
public void ModifyProperties(Role role, Perm perm) throws Exception {
XMLElement req = new XMLElement(AccountConstants.MODIFY_PROPERTIES_REQUEST);
accessTest(role, perm, req);
}
use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class TestAccess method Auth.
// ================= APIs ================
public void Auth(Role role, Perm perm) throws Exception {
XMLElement req = new XMLElement(AccountConstants.AUTH_REQUEST);
Element a = req.addElement(AccountConstants.E_ACCOUNT);
a.addAttribute(AccountConstants.A_BY, "name");
a.setText(ACCT_2_EMAIL);
req.addElement(AccountConstants.E_PASSWORD).setText(PASSWORD);
accessTest(role, perm, req);
}
use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class TestAccess method GetIdentities.
public void GetIdentities(Role role, Perm perm) throws Exception {
XMLElement req = new XMLElement(AccountConstants.GET_IDENTITIES_REQUEST);
accessTest(role, perm, req);
}
Aggregations