/** * Obtain the current <code>SecurityContext</code>. * * @return the security context (never <code>null</code>) */ public static SecurityContext getContext() { return strategy.getContext(); }
/** * Explicitly clears the context value from the current thread. */ public static void clearContext() { strategy.clearContext(); }
/** * Delegates the creation of a new, empty context to the configured strategy. */ public static SecurityContext createEmptyContext() { return strategy.createEmptyContext(); }
/** * Associates a new <code>SecurityContext</code> with the current thread of execution. * * @param context the new <code>SecurityContext</code> (may not be <code>null</code>) */ public static void setContext(SecurityContext context) { strategy.setContext(context); }
/** * Associates a new <code>SecurityContext</code> with the current thread of execution. * * @param context the new <code>SecurityContext</code> (may not be <code>null</code>) */ public static void setContext(SecurityContext context) { strategy.setContext(context); }
/** * Obtain the current <code>SecurityContext</code>. * * @return the security context (never <code>null</code>) */ public static SecurityContext getContext() { return strategy.getContext(); }
/** * Explicitly clears the context value from the current thread. */ public static void clearContext() { strategy.clearContext(); }
/** * Associates a new <code>SecurityContext</code> with the current thread of execution. * * @param context the new <code>SecurityContext</code> (may not be <code>null</code>) */ public static void setContext(SecurityContext context) { strategy.setContext(context); }
/** * Delegates the creation of a new, empty context to the configured strategy. */ public static SecurityContext createEmptyContext() { return strategy.createEmptyContext(); }
/** * Obtain the current <code>SecurityContext</code>. * * @return the security context (never <code>null</code>) */ public static SecurityContext getContext() { return strategy.getContext(); }
/** * Explicitly clears the context value from the current thread. */ public static void clearContext() { strategy.clearContext(); }
/** * Associates a new <code>SecurityContext</code> with the current thread of execution. * * @param context the new <code>SecurityContext</code> (may not be <code>null</code>) */ public static void setContext(SecurityContext context) { strategy.setContext(context); }
/** * Delegates the creation of a new, empty context to the configured strategy. */ public static SecurityContext createEmptyContext() { return strategy.createEmptyContext(); }
/** * Obtain the current <code>SecurityContext</code>. * * @return the security context (never <code>null</code>) */ public static SecurityContext getContext() { return strategy.getContext(); }
/** * Explicitly clears the context value from the current thread. */ public static void clearContext() { strategy.clearContext(); }
/** * Delegates the creation of a new, empty context to the configured strategy. */ public static SecurityContext createEmptyContext() { return strategy.createEmptyContext(); }
@Override public User getCurrentUser() throws IOException { Authentication auth = securityContextHolderStrategy.getContext().getAuthentication(); if (auth == null) { return null; } User user = securityManager.getUserByLoginName(auth.getName()); if (user == null && auth.isAuthenticated()) { user = new UserImpl(); user.setAdmin(true); user.setActive(true); } return user; }