Package com.ketayao.utils

Source Code of com.ketayao.utils.SecurityUtils

/**
*
*/
package com.ketayao.utils;

import org.apache.shiro.subject.Subject;

import com.ketayao.ketacustom.entity.main.User;
import com.ketayao.ketacustom.shiro.ShiroUser;

/**
* @author KETAYAO
*
*/
public abstract class SecurityUtils {
  public static User getLoginUser() {
    return getShiroUser().getUser();
  }
 
  public static ShiroUser getShiroUser() {
    Subject subject = getSubject();
    ShiroUser shiroUser = (ShiroUser)subject.getPrincipal();
   
    return shiroUser;
  }

  public static Subject getSubject() {
    return org.apache.shiro.SecurityUtils.getSubject();
  }
}
TOP

Related Classes of com.ketayao.utils.SecurityUtils

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.