@SuppressWarnings("unchecked")
    private List<PrincipalCollection> getRunAsPrincipalsStack() {
        Session session = getSession(false);
        if (session != null) {
            try {
                return (List<PrincipalCollection>) session.getAttribute(RUN_AS_PRINCIPALS_SESSION_KEY);
            } catch (SessionException se) {
                // There could be a rare race condition when a session is invalidated in another thread,
                // this thread could throw this exception, so we catch it
                // similar issue as in clearRunAsIdentitiesInternal()
                // See https://issues.apache.org/jira/browse/SHIRO-512
                LOGGER.debug("Encountered session exception trying to get 'runAs' principal stack.  This "
                        + "can generally safely be ignored.", se);
            }
        }
        return null;
    }
Returns {@code true} if this Subject is allowed to create sessions, {@code false} otherwise.

@return {@code true} if this Subject is allowed to create sessions, {@code false} otherwise.
@since 1.2
core/src/main/java/org/apache/shiro/subject/support/DelegatingSubject.java