Search in sources :

Example 6 with User

use of com.fruit.manage.model.User in project fruit-manage by liuzhaozhao.

the class ShiroDbRealm method doGetAuthorizationInfo.

/**
 * 权限认证
 *
 * @param principalCollection
 * @return
 */
@Override
protected AuthorizationInfo doGetAuthorizationInfo(PrincipalCollection principals) {
    User user = (User) principals.getPrimaryPrincipal();
    SimpleAuthorizationInfo info = new SimpleAuthorizationInfo();
    if (user == null) {
        return info;
    }
    int id = user.getId();
    authRole(id, info);
    return info;
}
Also used : User(com.fruit.manage.model.User) SimpleAuthorizationInfo(org.apache.shiro.authz.SimpleAuthorizationInfo)

Aggregations

User (com.fruit.manage.model.User)6 ProcurementPlan (com.fruit.manage.model.ProcurementPlan)2 ProcurementPlanDetail (com.fruit.manage.model.ProcurementPlanDetail)2 RequiresPermissions (org.apache.shiro.authz.annotation.RequiresPermissions)2 ExcelException (com.fruit.manage.util.excel.ExcelException)1 ExcelRdException (com.fruit.manage.util.excelRd.ExcelRdException)1 Before (com.jfinal.aop.Before)1 IOException (java.io.IOException)1 SimpleAuthenticationInfo (org.apache.shiro.authc.SimpleAuthenticationInfo)1 UsernamePasswordToken (org.apache.shiro.authc.UsernamePasswordToken)1 SimpleAuthorizationInfo (org.apache.shiro.authz.SimpleAuthorizationInfo)1