| package com.matrix.system.common.tools; | 
|   | 
| import com.matrix.core.constance.MatrixConstance; | 
| import com.matrix.core.tools.WebUtil; | 
| import com.matrix.system.common.bean.SysUsers; | 
| import com.matrix.system.common.constance.AppConstance; | 
| import com.matrix.system.constance.Dictionary; | 
|   | 
| /** | 
|  * 数据权限工具 | 
|  */ | 
| public class DataAuthUtil { | 
|   | 
|   | 
|     /** | 
|      * 是否具有门店数据权限 | 
|      * 1、管理员或者角色具有所有店铺权限的人可以查询 | 
|      * | 
|      * @return | 
|      */ | 
|     public static boolean hasAllShopAuth() { | 
|         SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); | 
|         return user.getShopRole().equals(Dictionary.FLAG_YES_Y) || user.getSuUserType().equals(AppConstance.USER_TYPE_ADMIN); | 
|   | 
|     } | 
|   | 
|   | 
| } |