use of com.zimbra.soap.admin.type.GranteeSelector in project zm-mailbox by Zimbra.
the class SoapProvisioning method getEffectiveRights.
@Override
public RightCommand.EffectiveRights getEffectiveRights(String targetType, TargetBy targetBy, String target, GranteeBy granteeBy, String grantee, boolean expandSetAttrs, boolean expandGetAttrs) throws ServiceException {
GranteeSelector granteeSel = null;
if (granteeBy != null && grantee != null) {
granteeSel = new GranteeSelector(granteeBy, grantee);
}
EffectiveRightsTargetSelector targetSel = new EffectiveRightsTargetSelector(com.zimbra.soap.type.TargetType.fromString(targetType), targetBy, target);
GetEffectiveRightsResponse resp = invokeJaxb(new GetEffectiveRightsRequest(targetSel, granteeSel, expandSetAttrs, expandGetAttrs));
return RightCommand.EffectiveRights.fromJaxb_EffectiveRights(resp);
}
use of com.zimbra.soap.admin.type.GranteeSelector in project zm-mailbox by Zimbra.
the class SoapProvisioning method getAllEffectiveRights.
@Override
public RightCommand.AllEffectiveRights getAllEffectiveRights(String granteeType, GranteeBy granteeBy, String grantee, boolean expandSetAttrs, boolean expandGetAttrs) throws ServiceException {
GranteeSelector granteeSel = null;
if (granteeType != null && granteeBy != null && grantee != null) {
granteeSel = new GranteeSelector(GranteeType.fromString(granteeType), granteeBy, grantee);
}
GetAllEffectiveRightsResponse resp = invokeJaxb(new GetAllEffectiveRightsRequest(granteeSel, expandSetAttrs, expandGetAttrs));
return RightCommand.AllEffectiveRights.fromJaxb(resp);
}
use of com.zimbra.soap.admin.type.GranteeSelector in project zm-mailbox by Zimbra.
the class TestServerEnumeration method grantRightToAdmin.
private static void grantRightToAdmin(SoapProvisioning adminSoapProv, TargetType targetType, String targetName, String granteeName, String rightName) throws ServiceException {
GranteeSelector grantee = new GranteeSelector(GranteeType.usr, GranteeBy.name, granteeName);
EffectiveRightsTargetSelector target = null;
if (targetName == null) {
target = new EffectiveRightsTargetSelector(targetType, null, null);
} else {
target = new EffectiveRightsTargetSelector(targetType, TargetBy.name, targetName);
}
RightModifierInfo right = new RightModifierInfo(rightName);
GrantRightResponse grResp = adminSoapProv.invokeJaxb(new GrantRightRequest(target, grantee, right));
assertNotNull("GrantRightResponse for " + right.getValue(), grResp);
}
use of com.zimbra.soap.admin.type.GranteeSelector in project zm-mailbox by Zimbra.
the class TestDomainAdmin method grantRight.
private void grantRight(SoapProvisioning soapProv, TargetType targetType, String targetName, GranteeType granteeType, String granteeName, String rightName) throws ServiceException {
GranteeSelector grantee;
EffectiveRightsTargetSelector target;
RightModifierInfo right;
GrantRightResponse grResp;
grantee = new GranteeSelector(granteeType, GranteeBy.name, granteeName);
target = new EffectiveRightsTargetSelector(targetType, TargetBy.name, targetName);
right = new RightModifierInfo(rightName);
grResp = soapProv.invokeJaxb(new GrantRightRequest(target, grantee, right));
assertNotNull("GrantRightResponse for " + right.getValue(), grResp);
}
use of com.zimbra.soap.admin.type.GranteeSelector in project zm-mailbox by Zimbra.
the class TestDomainAdmin method failToGrantRight.
private void failToGrantRight(SoapProvisioning soapProv, TargetType targetType, String targetName, String granteeName, String rightName, String expectedFailureReason) throws ServiceException {
GranteeSelector grantee;
EffectiveRightsTargetSelector target;
RightModifierInfo right;
grantee = new GranteeSelector(GranteeType.usr, GranteeBy.name, granteeName);
target = new EffectiveRightsTargetSelector(targetType, TargetBy.name, targetName);
right = new RightModifierInfo(rightName);
try {
soapProv.invokeJaxb(new GrantRightRequest(target, grantee, right));
fail(String.format("granting %s right succeeded when it shouldn't have", rightName));
} catch (SoapFaultException sfe) {
checkSoapReason(sfe, expectedFailureReason);
}
}
Aggregations