return isAnonymous(currentSubject());
}
- /**
- * Whether a user is currently authenticated. @deprecate User !isAnonymous()
- * instead.
- */
- @Deprecated
- public static boolean isRegistered() {
- return !isAnonymous();
- }
-
/** Roles of the currently logged-in user */
public final static Set<String> roles() {
return roles(currentSubject());
}
/** Executes as the current user */
- public final static <T> T doAs(PrivilegedExceptionAction<T> action) throws PrivilegedActionException {
+ public final static <T> T tryAs(PrivilegedExceptionAction<T> action) throws PrivilegedActionException {
return Subject.doAs(currentSubject(), action);
}