Search in sources :

Example 6 with EffectiveRightsTargetSelector

use of com.zimbra.soap.admin.type.EffectiveRightsTargetSelector 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 EffectiveRightsTargetSelector

use of com.zimbra.soap.admin.type.EffectiveRightsTargetSelector 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

EffectiveRightsTargetSelector (com.zimbra.soap.admin.type.EffectiveRightsTargetSelector)7 GrantRightRequest (com.zimbra.soap.admin.message.GrantRightRequest)6 GranteeSelector (com.zimbra.soap.admin.type.GranteeSelector)6 RightModifierInfo (com.zimbra.soap.admin.type.RightModifierInfo)6 GrantRightResponse (com.zimbra.soap.admin.message.GrantRightResponse)4 ServiceException (com.zimbra.common.service.ServiceException)1 Element (com.zimbra.common.soap.Element)1 SoapFaultException (com.zimbra.common.soap.SoapFaultException)1 RightModifier (com.zimbra.cs.account.accesscontrol.RightModifier)1 ZimbraSoapContext (com.zimbra.soap.ZimbraSoapContext)1 FlushCacheRequest (com.zimbra.soap.admin.message.FlushCacheRequest)1 CacheEntrySelector (com.zimbra.soap.admin.type.CacheEntrySelector)1 CacheSelector (com.zimbra.soap.admin.type.CacheSelector)1 TargetBy (com.zimbra.soap.type.TargetBy)1