Search in sources :

Example 1 with AllowedAttrs

use of com.zimbra.cs.account.accesscontrol.AllowedAttrs in project zm-mailbox by Zimbra.

the class TestACLAttrRight method verify.

private void verify(Account grantee, Entry target, GetOrSet getOrSet, AllowedAttrs expected) throws Exception {
    // call RightChecker directly instead of mAM, we want to verify the interim result.
    AllowedAttrs allowedAttrs = getOrSet.isGet() ? CheckAttrRight.accessibleAttrs(new Grantee(grantee), target, AdminRight.PR_GET_ATTRS, false) : CheckAttrRight.accessibleAttrs(new Grantee(grantee), target, AdminRight.PR_SET_ATTRS, false);
    // System.out.println("========== Test result ==========\n" + allowedAttrs.dump());
    verifyEquals(expected, allowedAttrs);
}
Also used : Grantee(com.zimbra.cs.account.accesscontrol.RightBearer.Grantee) AllowedAttrs(com.zimbra.cs.account.accesscontrol.AllowedAttrs)

Example 2 with AllowedAttrs

use of com.zimbra.cs.account.accesscontrol.AllowedAttrs in project zm-mailbox by Zimbra.

the class TestACL method verify.

protected void verify(Account grantee, Entry target, GetOrSet getOrSet, AllowedAttrs expected) {
    try {
        // call RightChecker directly instead of mAM, we want to verify the interim result.
        AllowedAttrs allowedAttrs = getOrSet.isGet() ? CheckAttrRight.accessibleAttrs(new Grantee(grantee), target, AdminRight.PR_GET_ATTRS, false) : CheckAttrRight.accessibleAttrs(new Grantee(grantee), target, AdminRight.PR_SET_ATTRS, false);
        // System.out.println("========== Test result ==========\n" + allowedAttrs.dump());
        assertEquals(expected, allowedAttrs);
    } catch (ServiceException e) {
        fail();
    }
}
Also used : Grantee(com.zimbra.cs.account.accesscontrol.RightBearer.Grantee) AllowedAttrs(com.zimbra.cs.account.accesscontrol.AllowedAttrs) ServiceException(com.zimbra.common.service.ServiceException)

Aggregations

AllowedAttrs (com.zimbra.cs.account.accesscontrol.AllowedAttrs)2 Grantee (com.zimbra.cs.account.accesscontrol.RightBearer.Grantee)2 ServiceException (com.zimbra.common.service.ServiceException)1