Static method to get user ID
This is a utility method. There's nothing wrong with it being static. Its readability would benefit greatly from (a) using guard clauses instead of having multiple nesting levels, (b) using java bracket style, and (c) using java spacing. You might also want to add logging to indicate why there's no signed-in user, which is presumably a WARN or ERROR, but should at least be a DEBUG.

public static int getSignedUpUser() {
    final SecurityContext ctx = SecurityContextHolder.getContext();

    if (ctx == null) {
        LOGGER.debug("No security context available");
        return 0;
    }

    final Authentication auth = ctx.getAuthentication();
    if (auth == null) {
        LOGGER.debug("No authentication available in security context {}", ctx);
        return 0;
    }  

    final Object principal = auth.getPrincipal();
    if (!(principal instanceof AUser) {
        LOGGER.warn("Principal {} is not an instance of AUser!", principal);
        return 0;
    }

    final AUser au = (AUser)principal;
    return au.getId();
}