forked from github/dataease
feat(组织管理中心): 新增血缘关系分析
This commit is contained in:
parent
11f4f4db59
commit
992800242d
@ -0,0 +1,22 @@
|
||||
package io.dataease.resource;
|
||||
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @Author Junjun
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/resource")
|
||||
public class ResourceApi {
|
||||
@Resource
|
||||
private ResourceService resourceService;
|
||||
|
||||
@PostMapping("checkPermission/{id}")
|
||||
public boolean checkPermission(@PathVariable("id") Long id) {
|
||||
return resourceService.checkPermission(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
package io.dataease.resource;
|
||||
|
||||
import io.dataease.api.permissions.auth.dto.BusiPerCheckDTO;
|
||||
import io.dataease.constant.AuthEnum;
|
||||
import io.dataease.system.manage.CorePermissionManage;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @Author Junjun
|
||||
*/
|
||||
@Component
|
||||
public class ResourceService {
|
||||
@Resource
|
||||
private CorePermissionManage corePermissionManage;
|
||||
|
||||
public boolean checkPermission(Long id) {
|
||||
BusiPerCheckDTO dto = new BusiPerCheckDTO();
|
||||
dto.setId(id);
|
||||
dto.setAuthEnum(AuthEnum.READ);
|
||||
boolean b;
|
||||
try {
|
||||
b = corePermissionManage.checkAuth(dto);
|
||||
} catch (Exception e) {
|
||||
b = false;
|
||||
}
|
||||
return b;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user