feat:增加安全判定

This commit is contained in:
wangyu 2022-03-09 10:27:05 +08:00
parent d5420fea49
commit 8c1f9d8a98
2 changed files with 2 additions and 2 deletions

View File

@ -88,7 +88,7 @@ public class DepartmentService extends BaseReactiveServiceImpl<Department> {
if (query instanceof DepartmentQo) {
DepartmentQo qo = (DepartmentQo) query;
// 如果是非管理员
if (qo.getUser().getType() != UserType.SUPER_ADMIN) {
if (null != qo.getUser() && qo.getUser().getType() != UserType.SUPER_ADMIN) {
// 占位包装查询实体
Mono<Qo<Department>> mono = Mono.just(qo);
// 使用列表内的部门作为条件

View File

@ -85,7 +85,7 @@ public class RoleService extends BaseReactiveServiceImpl<Role> {
// 基于创建者进行筛选
if (query instanceof RoleQo) {
IUser user = query.getUser();
if (user.getType() != UserType.SUPER_ADMIN) {
if (null != user && user.getType() != UserType.SUPER_ADMIN) {
return getOwnedIds(user)
.flatMapMany(ids -> {
RoleQo qo = (RoleQo) query;