accessLevelRestriction.setMinimumAccessLevel(accessLevel.minimumAccessLevel());
accessLevelRestriction.setMaximumAccessLevel(accessLevel.maximumAccessLevel());
restrictions.add(accessLevelRestriction);
}
if (clazz.isAnnotationPresent(Roles.class)){
Roles roles = clazz.getAnnotation(Roles.class);
RolesRestriction rolesRestriction = new RolesRestriction();
rolesRestriction.setRoles(this.getRoles(roles));
rolesRestriction.setPolicy(roles.policy());
restrictions.add(rolesRestriction);
}
return new RestrictionsWrapper(clazz.getAnnotation(InheritRestrictions.class), clazz.getAnnotation(OnAccessDenial.class), restrictions);
}