Search in sources :

Example 1 with GrantRightResponse

use of com.zimbra.soap.admin.message.GrantRightResponse 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);
}
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 2 with GrantRightResponse

use of com.zimbra.soap.admin.message.GrantRightResponse 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);
}
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 3 with GrantRightResponse

use of com.zimbra.soap.admin.message.GrantRightResponse 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 4 with GrantRightResponse

use of com.zimbra.soap.admin.message.GrantRightResponse 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

GrantRightRequest (com.zimbra.soap.admin.message.GrantRightRequest)4 GrantRightResponse (com.zimbra.soap.admin.message.GrantRightResponse)4 EffectiveRightsTargetSelector (com.zimbra.soap.admin.type.EffectiveRightsTargetSelector)4 GranteeSelector (com.zimbra.soap.admin.type.GranteeSelector)4 RightModifierInfo (com.zimbra.soap.admin.type.RightModifierInfo)4