use of com.zimbra.cs.account.accesscontrol.ViaGrantImpl 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;
}
Aggregations