public void runAs(PrincipalCollection principals) {
        if (!hasPrincipals()) {
            String msg = "This subject does not yet have an identity.  Assuming the identity of another "
                    + "Subject is only allowed for Subjects with an existing identity.  Try logging this subject in "
                    + "first, or using the " + Subject.Builder.class.getName() + " to build ad hoc Subject instances "
                    + "with identities as necessary.";
            throw new IllegalStateException(msg);
        }
        pushIdentity(principals);
    }
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