assertTrue("User should have had Manage Roles Read access.", user.hasPrivilege(allowedPriv));
}
public void testUserHasInvalidPrivilege() throws Exception {
AuthenticatedUserVo user = new AuthenticatedUserVo();
user.setUserRolePrivileges(createUserRolePrivileges());
UserPrivilegeVo allowedPriv = createUserPrivilegeVo(UserPrivilegeType.Key.MANAGE_MY_PROFILE_KEY,
PrivilegeActionType.Key.READ_KEY);
assertFalse("User should not ave had Manage My Profile Read access.",
user.hasPrivilege(allowedPriv));
allowedPriv = createUserPrivilegeVo(UserPrivilegeType.Key.VIEW_ALL_PROJECTS_KEY,
PrivilegeActionType.Key.READ_KEY);
assertFalse("User should not have had View All Projects Read access.",
user.hasPrivilege(allowedPriv));
}