Search in sources :

Example 6 with GranteeSelector

use of com.zimbra.soap.admin.type.GranteeSelector in project zm-mailbox by Zimbra.

the class TestLockoutMailbox 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);
}
Also used : RightModifierInfo(com.zimbra.soap.admin.type.RightModifierInfo) GrantRightRequest(com.zimbra.soap.admin.message.GrantRightRequest) GranteeSelector(com.zimbra.soap.admin.type.GranteeSelector) GrantRightResponse(com.zimbra.soap.admin.message.GrantRightResponse) EffectiveRightsTargetSelector(com.zimbra.soap.admin.type.EffectiveRightsTargetSelector)

Example 7 with GranteeSelector

use of com.zimbra.soap.admin.type.GranteeSelector in project zm-mailbox by Zimbra.

the class TestUtil method grantRightToAdmin.

public static void grantRightToAdmin(SoapProvisioning adminSoapProv, TargetType targetType, String targetName, String granteeName, String rightName) throws ServiceException {
    GranteeSelector grantee = new GranteeSelector(com.zimbra.soap.type.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);
}
Also used : RightModifierInfo(com.zimbra.soap.admin.type.RightModifierInfo) GrantRightRequest(com.zimbra.soap.admin.message.GrantRightRequest) GranteeSelector(com.zimbra.soap.admin.type.GranteeSelector) GrantRightResponse(com.zimbra.soap.admin.message.GrantRightResponse) EffectiveRightsTargetSelector(com.zimbra.soap.admin.type.EffectiveRightsTargetSelector)

Aggregations

GranteeSelector (com.zimbra.soap.admin.type.GranteeSelector)7 EffectiveRightsTargetSelector (com.zimbra.soap.admin.type.EffectiveRightsTargetSelector)6 GrantRightRequest (com.zimbra.soap.admin.message.GrantRightRequest)5 RightModifierInfo (com.zimbra.soap.admin.type.RightModifierInfo)5 GrantRightResponse (com.zimbra.soap.admin.message.GrantRightResponse)4 SoapFaultException (com.zimbra.common.soap.SoapFaultException)1