|
@@ -6,9 +6,11 @@ package org.eco.vip.auth.service.permission;
|
|
|
|
|
|
|
|
|
|
import com.mybatisflex.core.query.QueryWrapper;
|
|
import com.mybatisflex.core.query.QueryWrapper;
|
|
|
|
+import jakarta.annotation.Resource;
|
|
import org.eco.vip.auth.domain.permission.Permission;
|
|
import org.eco.vip.auth.domain.permission.Permission;
|
|
import org.eco.vip.auth.domain.permission.pojo.PermissionVO;
|
|
import org.eco.vip.auth.domain.permission.pojo.PermissionVO;
|
|
import org.eco.vip.auth.mapper.PermissionMapper;
|
|
import org.eco.vip.auth.mapper.PermissionMapper;
|
|
|
|
+import org.eco.vip.auth.service.menu.IMenuService;
|
|
import org.eco.vip.orm.service.BaseService;
|
|
import org.eco.vip.orm.service.BaseService;
|
|
import org.eco.vip.orm.utils.BeanUtils;
|
|
import org.eco.vip.orm.utils.BeanUtils;
|
|
import org.eco.vip.orm.utils.StrUtils;
|
|
import org.eco.vip.orm.utils.StrUtils;
|
|
@@ -31,6 +33,9 @@ import java.util.Set;
|
|
@Service
|
|
@Service
|
|
public class PermissionService extends BaseService<PermissionMapper, Permission> implements IPermissionService, ISecurityPermissionService {
|
|
public class PermissionService extends BaseService<PermissionMapper, Permission> implements IPermissionService, ISecurityPermissionService {
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
+ private IMenuService menuService;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public List<PermissionVO> selectList() {
|
|
public List<PermissionVO> selectList() {
|
|
QueryWrapper queryWrapper = new QueryWrapper();
|
|
QueryWrapper queryWrapper = new QueryWrapper();
|
|
@@ -38,17 +43,23 @@ public class PermissionService extends BaseService<PermissionMapper, Permission>
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public Set<String> getMenuPermission(String userId) {
|
|
|
|
- return Set.of();
|
|
|
|
|
|
+ public Set<String> getPermissionCodes(String userId) {
|
|
|
|
+ Set<String> perms = new HashSet<>();
|
|
|
|
+ if (LoginHelper.isSuperAdmin(userId)) {
|
|
|
|
+ perms.add("*:*:*");
|
|
|
|
+ } else {
|
|
|
|
+ perms.addAll(null);
|
|
|
|
+ }
|
|
|
|
+ return perms;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public Set<String> getRolePermission(String userId) {
|
|
|
|
|
|
+ public Set<String> getRoleCodes(String userId) {
|
|
Set<String> perms = new HashSet<>();
|
|
Set<String> perms = new HashSet<>();
|
|
if (LoginHelper.isSuperAdmin(userId)) {
|
|
if (LoginHelper.isSuperAdmin(userId)) {
|
|
perms.add("*:*:*");
|
|
perms.add("*:*:*");
|
|
} else {
|
|
} else {
|
|
- QueryWrapper queryWrapper = new QueryWrapper();
|
|
|
|
|
|
+ perms.addAll(null);
|
|
}
|
|
}
|
|
|
|
|
|
return perms;
|
|
return perms;
|