All Downloads are FREE. Search and download functionalities are using the official Maven repository.

mtons.shiro.authc.UserSubject Maven / Gradle / Ivy

The newest version!
package mtons.shiro.authc;

import mtons.pojos.UserProfile;
import org.apache.shiro.mgt.SecurityManager;
import org.apache.shiro.session.Session;
import org.apache.shiro.subject.PrincipalCollection;
import org.apache.shiro.web.subject.support.WebDelegatingSubject;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

public class UserSubject extends WebDelegatingSubject {
    public UserSubject(PrincipalCollection principals, boolean authenticated, String host, Session session,
                       boolean sessionEnabled, ServletRequest request, ServletResponse response, SecurityManager securityManager) {
        super(principals, authenticated, host, session, sessionEnabled, request, response, securityManager);
    }

    public UserProfile getProfile() {
        if (null != getPrincipal() && getPrincipal() instanceof UserProfile) {
            return (UserProfile) getPrincipal();
        }
        return null;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy