return rolesAllowed != null || denyAll;
}
public ServerResponse preProcess(HttpRequest request, ResourceMethod method) throws Failure, WebApplicationException
{
if (denyAll) throw new UnauthorizedException();
if (rolesAllowed != null)
{
SecurityContext context = ResteasyProviderFactory.getContextData(SecurityContext.class);
if (context != null)
{
for (String role : rolesAllowed)
{
if (context.isUserInRole(role)) return null;
}
throw new UnauthorizedException();
}
}
return null;
}