use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class SoapProvisioning method getGrants.
@Override
public RightCommand.Grants getGrants(String targetType, TargetBy targetBy, String target, String granteeType, GranteeBy granteeBy, String grantee, boolean granteeIncludeGroupsGranteeBelongs) throws ServiceException {
XMLElement req = new XMLElement(AdminConstants.GET_GRANTS_REQUEST);
if (targetType != null)
toXML(req, targetType, targetBy, target);
if (granteeType != null) {
Element eGrantee = toXML(req, granteeType, granteeBy, grantee);
eGrantee.addAttribute(AdminConstants.A_ALL, granteeIncludeGroupsGranteeBelongs);
}
Element resp = invoke(req);
return new RightCommand.Grants(resp);
}
use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class SoapProvisioning method modifySignature.
@Override
public void modifySignature(Account account, String signatureId, Map<String, Object> attrs) throws ServiceException {
if (attrs.get(Provisioning.A_zimbraSignatureId) != null)
throw ZClientException.CLIENT_ERROR("invalid attr: " + Provisioning.A_zimbraSignatureId, null);
XMLElement req = new XMLElement(AccountConstants.MODIFY_SIGNATURE_REQUEST);
Element signature = req.addElement(AccountConstants.E_SIGNATURE);
signature.addAttribute(AccountConstants.A_ID, signatureId);
SoapSignature.toXML(signature, attrs);
invokeOnTargetAccount(req, account.getId());
}
use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class SoapProvisioning method checkRight.
@Override
public boolean checkRight(String targetType, TargetBy targetBy, String target, GranteeBy granteeBy, String grantee, String right, Map<String, Object> attrs, AccessManager.ViaGrant via) throws ServiceException {
XMLElement req = new XMLElement(AdminConstants.CHECK_RIGHT_REQUEST);
toXML(req, targetType, targetBy, target);
toXML(req, null, granteeBy, grantee);
toXML(req, right, null);
SoapProvisioning.addAttrElements(req, attrs);
Element resp = invoke(req);
boolean result = resp.getAttributeBool(AdminConstants.A_ALLOW);
if (via != null) {
Element eVia = resp.getOptionalElement(AdminConstants.E_VIA);
if (eVia != null) {
Element eTarget = eVia.getElement(AdminConstants.E_TARGET);
Element eGrantee = eVia.getElement(AdminConstants.E_GRANTEE);
Element eRight = eVia.getElement(AdminConstants.E_RIGHT);
via.setImpl(new ViaGrantImpl(eTarget.getAttribute(AdminConstants.A_TYPE), eTarget.getText(), eGrantee.getAttribute(AdminConstants.A_TYPE), eGrantee.getText(), eRight.getText(), eRight.getAttributeBool(AdminConstants.A_DENY, false)));
}
}
return result;
}
use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class SoapProvisioning method modifyConfigSMIMEConfig.
@Override
public void modifyConfigSMIMEConfig(String configName, Map<String, Object> attrs) throws ServiceException {
XMLElement req = new XMLElement(AdminConstants.MODIFY_SMIME_CONFIG_REQUEST);
Element eConfig = req.addElement(AdminConstants.E_CONFIG);
eConfig.addAttribute(AdminConstants.A_NAME, configName);
eConfig.addAttribute(AdminConstants.A_OP, AdminConstants.OP_MODIFY);
addAttrElements(eConfig, attrs);
invoke(req);
}
use of com.zimbra.common.soap.Element.XMLElement in project zm-mailbox by Zimbra.
the class SoapUCService method modifyAttrs.
public void modifyAttrs(SoapProvisioning prov, Map<String, ? extends Object> attrs, boolean checkImmutable) throws ServiceException {
XMLElement req = new XMLElement(AdminConstants.MODIFY_UC_SERVICE_REQUEST);
req.addElement(AdminConstants.E_ID).setText(getId());
SoapProvisioning.addAttrElements(req, attrs);
setAttrs(SoapProvisioning.getAttrs(prov.invoke(req).getElement(AdminConstants.E_UC_SERVICE)));
}
Aggregations