feat:增加安全判定
This commit is contained in:
parent
d5420fea49
commit
8c1f9d8a98
@ -88,7 +88,7 @@ public class DepartmentService extends BaseReactiveServiceImpl<Department> {
|
|||||||
if (query instanceof DepartmentQo) {
|
if (query instanceof DepartmentQo) {
|
||||||
DepartmentQo qo = (DepartmentQo) query;
|
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);
|
Mono<Qo<Department>> mono = Mono.just(qo);
|
||||||
// 使用列表内的部门作为条件
|
// 使用列表内的部门作为条件
|
||||||
|
@ -85,7 +85,7 @@ public class RoleService extends BaseReactiveServiceImpl<Role> {
|
|||||||
// 基于创建者进行筛选
|
// 基于创建者进行筛选
|
||||||
if (query instanceof RoleQo) {
|
if (query instanceof RoleQo) {
|
||||||
IUser user = query.getUser();
|
IUser user = query.getUser();
|
||||||
if (user.getType() != UserType.SUPER_ADMIN) {
|
if (null != user && user.getType() != UserType.SUPER_ADMIN) {
|
||||||
return getOwnedIds(user)
|
return getOwnedIds(user)
|
||||||
.flatMapMany(ids -> {
|
.flatMapMany(ids -> {
|
||||||
RoleQo qo = (RoleQo) query;
|
RoleQo qo = (RoleQo) query;
|
||||||
|
Loading…
Reference in New Issue
Block a user