| | |
| | | |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.gkhy.exam.common.annotation.DataScope; |
| | | import com.gkhy.exam.common.api.CommonPage; |
| | | import com.gkhy.exam.common.constant.UserConstant; |
| | | import com.gkhy.exam.common.domain.entity.SysRole; |
| | | import com.gkhy.exam.common.domain.entity.SysUser; |
| | | import com.gkhy.exam.common.exception.ApiException; |
| | | import com.gkhy.exam.common.utils.PageUtils; |
| | | import com.gkhy.exam.common.utils.SecurityUtils; |
| | |
| | | import com.gkhy.exam.system.mapper.SysRoleMenuMapper; |
| | | import com.gkhy.exam.system.mapper.SysUserRoleMapper; |
| | | import com.gkhy.exam.system.service.ISysRoleService; |
| | | import com.google.protobuf.ServiceException; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | @Override |
| | | public void checkRoleDataScope(Long... roleIds) |
| | | { |
| | | if (!SysUser.isAdmin(SecurityUtils.getUserId())) |
| | | if (!SecurityUtils.adminUser()) |
| | | { |
| | | for (Long roleId : roleIds) |
| | | { |
| | | SysRole role = new SysRole(); |
| | | role.setRoleId(roleId); |
| | | List<SysRole> roles = (List<SysRole>) SpringUtils.getAopProxy(this).selectRoleList(role); |
| | | List<SysRole> roles = (List<SysRole>) SpringUtils.getAopProxy(this).selectRoleList(role).getList(); |
| | | if (ObjectUtil.isEmpty(roles)) |
| | | { |
| | | throw new ApiException("没有权限访问角色数据!"); |