Merge pull request '261102_01_ENH: 프로젝트 접근 권한 확인 API 추가 및 공통 사용자 Context 적용' (#5) from develop into master
Reviewed-on: #5
This commit is contained in:
@@ -21,6 +21,7 @@ Source: .agent/consumer-references/platform-capabilities.md
|
||||
- Common Web may register error handling, tracing/MDC, request-user resolution, enum conversion, and CORS behavior. Check for overlap before defining consumer-local equivalents.
|
||||
- Swagger support requires springdoc and defines the shared Bearer/API-key schemes and grouped paths.
|
||||
- When Swagger auto-configuration is active (`kri.swagger.enabled=true`, default), `RequestUserContext` controller arguments are ignored as request inputs globally, including their `authenticated`, `clientIp`, and `userRole` properties. Runtime argument resolution is unchanged.
|
||||
- `RequestUserContextProvider` is a public injectable API for resolving the same request identity and client IP used by controller arguments. Its default registration requires Web integration and JwtService; a consumer provider overrides it. Existing principal/details/verified-Bearer fallback, empty-context behavior, resolver overrides and the JwtService resolver constructor remain unchanged. The provider does not enforce authentication or business authorization.
|
||||
- Redis and scheduling are opt-in through their `kri.*.enabled` settings and matching runtime dependencies.
|
||||
- HTTP bypass targets are server-configured. Never accept an arbitrary full target URL from a frontend; retain allowed-path checks and do not forward hop-by-hop headers.
|
||||
- The external API client returns response bodies as documented, while bypass responses preserve raw bytes and target `Content-Type`.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## KART Server Repository Rules
|
||||
|
||||
- Java 17, Spring Boot 3.5.7, KriCommon `com.kri.common:starter:beta.1.6.9`.
|
||||
- Java 17, Spring Boot 3.5.7, KriCommon `com.kri.common:starter:beta.1.7.1`.
|
||||
- Use MyBatis with explicit KON, KONKIWI and kart (Report DB) SQL Server sessions and transaction managers. Do not infer a source from pkey alone.
|
||||
- ProjectType codes are 0=KON and 1=KIWI; reject unsupported types and legacy key markers in new project identifiers.
|
||||
- This API is for the new system. Legacy API compatibility is not required; shared database compatibility is required.
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
- Follow Contact: inject com.kri.common.feature.web.RequestUserContext ctx into controller methods; use ctx.getUserRole() and ctx.getUserTeam() for authorization and pass them to the service as needed.
|
||||
- Use only the context resolved by common authentication, never role/team fields submitted in request DTOs.
|
||||
- Place Spring MVC interceptors under the interceptor package. Inject KriCommon RequestUserContextProvider to resolve request identity; keep project and share-link authorization policies in KART.
|
||||
- Do not introduce separate PrincipalKind/ProjectPermission/ReportPage enums or generic grant models for this purpose.
|
||||
- External authentication must still enforce its stored project/page scope and restrict access to report reads and aggregate Excel; role/team alone must not authorize access outside the link scope.
|
||||
|
||||
|
||||
@@ -246,6 +246,8 @@ When implementation is complete, report in Korean:
|
||||
- For HTTP/2 header safety and original upstream error propagation, use the shared HTTP/bypass features documented in the routed platform-capabilities reference instead of implementing consumer-local header filters and raw-response exception handlers.
|
||||
- Response customizers may call `requireSuccess()`; its upstream exception propagates unchanged. Response charset parsing ignores charset-like text inside other quoted header parameters.
|
||||
- When Swagger auto-configuration is active, `RequestUserContext` controller arguments are excluded from request input documentation; server-side authentication and client IP injection remain unchanged.
|
||||
- `RequestUserContextProvider` is a public injectable API for resolving the same request identity and client IP used by controller arguments. Its default registration requires Web integration and JwtService; a consumer provider overrides it. Existing principal/details/verified-Bearer fallback, empty-context behavior, resolver overrides and the JwtService resolver constructor remain unchanged. The provider does not enforce authentication or business authorization.
|
||||
- ExcelMapper's Path-based readStreaming and readHeaderStreaming use PackageAccess.READ, preserving source bytes, size, and modification time, including repeated reads and callback failures. Read-only files are supported, and file handles are released on success or failure; option validation, exception handling, and SAX streaming remain unchanged.
|
||||
- Do not modify KriCommon or another consumer repository unless it is explicitly included in the approved task scope.
|
||||
|
||||
### Required Shared References
|
||||
|
||||
@@ -55,7 +55,7 @@ configurations.configureEach {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'com.kri.common:starter:beta.1.7.0'
|
||||
implementation 'com.kri.common:starter:beta.1.7.1'
|
||||
implementation 'org.apache.poi:poi-ooxml:5.5.1'
|
||||
implementation "kr.pe.bab2min:kiwi-java:${kiwiVersion}:${kiwiPlatform}@jar"
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.kri.kart.server.config;
|
||||
|
||||
import com.kri.common.feature.web.RequestUserContextProvider;
|
||||
import com.kri.kart.server.interceptor.ProjectAccessInterceptor;
|
||||
import com.kri.kart.server.service.ProjectService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
|
||||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@RequiredArgsConstructor
|
||||
@ConditionalOnProperty(prefix = "kri.kart.database", name = "enabled", havingValue = "true")
|
||||
public class ProjectAccessConfig implements WebMvcConfigurer {
|
||||
private final RequestUserContextProvider requestUserContextProvider;
|
||||
private final ProjectService projectService;
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(new ProjectAccessInterceptor(requestUserContextProvider, projectService))
|
||||
.addPathPatterns("/api/v1/**")
|
||||
.order(1);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
package com.kri.kart.server.config;
|
||||
|
||||
import com.kri.common.feature.web.RequestUserContextProvider;
|
||||
import com.kri.kart.server.interceptor.ExternalAccessInterceptor;
|
||||
import com.kri.kart.server.service.ShareLinkService;
|
||||
import com.kri.kart.server.service.share.ExternalAccessInterceptor;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
@@ -14,10 +15,13 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
||||
@RequiredArgsConstructor
|
||||
@ConditionalOnProperty(prefix = "kri.kart.database", name = "enabled", havingValue = "true")
|
||||
public class ShareLinkConfig implements WebMvcConfigurer {
|
||||
private final RequestUserContextProvider requestUserContextProvider;
|
||||
private final ShareLinkService shareLinkService;
|
||||
|
||||
@Override
|
||||
public void addInterceptors(InterceptorRegistry registry) {
|
||||
registry.addInterceptor(new ExternalAccessInterceptor(shareLinkService)).addPathPatterns("/**");
|
||||
registry.addInterceptor(new ExternalAccessInterceptor(requestUserContextProvider, shareLinkService))
|
||||
.addPathPatterns("/**")
|
||||
.order(0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,8 +4,10 @@ import com.kri.common.feature.web.BusinessException;
|
||||
import com.kri.common.feature.web.RequestUserContext;
|
||||
import com.kri.kart.server.common.consts.KartConstant;
|
||||
import com.kri.kart.server.dto.log.VisitLogRequestDto;
|
||||
import com.kri.kart.server.dto.project.ProjectRefDto;
|
||||
import com.kri.kart.server.dto.share.ShareLinkDto;
|
||||
import com.kri.kart.server.service.LogService;
|
||||
import com.kri.kart.server.service.ProjectService;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.validation.Valid;
|
||||
@@ -23,6 +25,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@ConditionalOnProperty(prefix = "kri.kart.database", name = "enabled", havingValue = "true")
|
||||
public class LogController {
|
||||
private final LogService logService;
|
||||
private final ProjectService projectService;
|
||||
|
||||
@PostMapping(value = "/visit", produces = MediaType.TEXT_PLAIN_VALUE)
|
||||
public String visit(
|
||||
@@ -36,6 +39,12 @@ public class LogController {
|
||||
|| !link.pkey().equals(request.pkey()))) {
|
||||
throw BusinessException.forbidden("EXTERNAL_SCOPE_DENIED", "공유 프로젝트의 방문 로그만 기록할 수 있습니다.");
|
||||
}
|
||||
if (link == null && (request.projectType() != null || request.pkey() != null)) {
|
||||
if (request.projectType() == null || request.pkey() == null) {
|
||||
throw BusinessException.badRequest("projectType과 pkey를 함께 입력해 주세요.");
|
||||
}
|
||||
projectService.requireAccess(new ProjectRefDto(request.projectType(), request.pkey()), ctx);
|
||||
}
|
||||
logService.writeVisitLog(
|
||||
request.projectType(), request.pkey(), request.logContent(), ctx);
|
||||
return "PASS";
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.kri.kart.server.dto.project.ProgressDayDto;
|
||||
import com.kri.kart.server.dto.project.ProgressScreenDto;
|
||||
import com.kri.kart.server.dto.project.ProgressSearchDto;
|
||||
import com.kri.kart.server.dto.project.ProgressTypeDto;
|
||||
import com.kri.kart.server.dto.project.ProjectAccessDto;
|
||||
import com.kri.kart.server.dto.project.ProjectLinkSearchDto;
|
||||
import com.kri.kart.server.dto.project.ProjectListDto;
|
||||
import com.kri.kart.server.dto.project.ProjectRefDto;
|
||||
@@ -15,6 +16,7 @@ import com.kri.kart.server.dto.project.ProjectSummaryDto;
|
||||
import com.kri.kart.server.service.CustomProgressService;
|
||||
import com.kri.kart.server.service.ProgressService;
|
||||
import com.kri.kart.server.service.ProjectService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import jakarta.validation.Valid;
|
||||
import java.util.List;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -35,6 +37,14 @@ public class ProjectController {
|
||||
private final ProgressService progressService;
|
||||
private final CustomProgressService customProgressService;
|
||||
|
||||
@GetMapping("/{projectType}/{pkey}/access")
|
||||
@Operation(summary = "프로젝트 접근 권한 확인", description = "접근 가능하면 allowed=true, 권한이 없으면 403을 반환합니다.")
|
||||
public ProjectAccessDto access(
|
||||
@PathVariable ProjectType projectType, @PathVariable String pkey, RequestUserContext ctx) {
|
||||
// The project interceptor applies the same authorization as every project-scoped route.
|
||||
return new ProjectAccessDto(true);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
public List<ProjectListDto> list(
|
||||
@Valid @ParameterObject @ModelAttribute ProjectLinkSearchDto search, RequestUserContext ctx) {
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.kri.kart.server.common.enums.ProjectType;
|
||||
import com.kri.kart.server.dto.project.ProjectRefDto;
|
||||
import com.kri.kart.server.dto.share.ShareLinkDto;
|
||||
import com.kri.kart.server.dto.share.ShareLinkRequestDto;
|
||||
import com.kri.kart.server.service.ProjectService;
|
||||
import com.kri.kart.server.service.ShareLinkService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import jakarta.validation.Valid;
|
||||
@@ -21,6 +22,7 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
@ConditionalOnProperty(prefix = "kri.kart.database", name = "enabled", havingValue = "true")
|
||||
public class ShareLinkController {
|
||||
private final ShareLinkService shareLinkService;
|
||||
private final ProjectService projectService;
|
||||
|
||||
@PostMapping("/api/v1/project/{projectType}/{pkey}/share")
|
||||
@Operation(summary = "공유 링크 발급 또는 재사용")
|
||||
@@ -34,7 +36,9 @@ public class ShareLinkController {
|
||||
|
||||
@GetMapping("/api/v1/share/{urlKey}")
|
||||
@Operation(summary = "공유 링크 정보 조회", description = "내부 인증 필요. 랜딩 횟수를 증가시키지 않는다.")
|
||||
public ShareLinkDto lookup(@PathVariable String urlKey) {
|
||||
return shareLinkService.lookup(urlKey);
|
||||
public ShareLinkDto lookup(@PathVariable String urlKey, RequestUserContext ctx) {
|
||||
ShareLinkDto link = shareLinkService.lookup(urlKey);
|
||||
projectService.requireAccess(new ProjectRefDto(link.projectType(), link.pkey()), ctx);
|
||||
return link;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
package com.kri.kart.server.dto.project;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
|
||||
@Schema(description = "프로젝트 접근 권한 확인 결과")
|
||||
public record ProjectAccessDto(boolean allowed) {}
|
||||
@@ -1,7 +1,8 @@
|
||||
package com.kri.kart.server.service.share;
|
||||
package com.kri.kart.server.interceptor;
|
||||
|
||||
import com.kri.common.feature.auth.dto.JwtUserClaimsDto;
|
||||
import com.kri.common.feature.web.BusinessException;
|
||||
import com.kri.common.feature.web.RequestUserContext;
|
||||
import com.kri.common.feature.web.RequestUserContextProvider;
|
||||
import com.kri.kart.server.common.consts.KartConstant;
|
||||
import com.kri.kart.server.dto.share.ShareLinkDto;
|
||||
import com.kri.kart.server.service.ShareLinkService;
|
||||
@@ -11,14 +12,13 @@ import java.net.URI;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
import org.springframework.web.servlet.HandlerMapping;
|
||||
|
||||
/** 공용 인증이 검증한 identity와 REPORT_URL을 사용한다. 일반 사용자 역할 제한과는 별개다. */
|
||||
@RequiredArgsConstructor
|
||||
public class ExternalAccessInterceptor implements HandlerInterceptor {
|
||||
private final RequestUserContextProvider requestUserContextProvider;
|
||||
private final ShareLinkService shareLinkService;
|
||||
|
||||
@Override
|
||||
@@ -31,17 +31,12 @@ public class ExternalAccessInterceptor implements HandlerInterceptor {
|
||||
// A new link or credential login may replace a previous external identity.
|
||||
return true;
|
||||
}
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
if (authentication == null
|
||||
|| !authentication.isAuthenticated()
|
||||
|| !(authentication.getDetails() instanceof JwtUserClaimsDto claims)) {
|
||||
return true;
|
||||
}
|
||||
String userId = claims.getUserId();
|
||||
RequestUserContext ctx = requestUserContextProvider.resolve(request);
|
||||
String userId = ctx.getUserId();
|
||||
boolean externalRole =
|
||||
Integer.valueOf(KartConstant.EXTERNAL_URL_COPY_ROLE).equals(claims.getUserRole())
|
||||
|| Integer.valueOf(KartConstant.EXTERNAL_PAGE_COPY_ROLE).equals(claims.getUserRole());
|
||||
boolean externalTeam = KartConstant.EXTERNAL_TEAM.equals(claims.getUserTeam());
|
||||
Integer.valueOf(KartConstant.EXTERNAL_URL_COPY_ROLE).equals(ctx.getUserRole())
|
||||
|| Integer.valueOf(KartConstant.EXTERNAL_PAGE_COPY_ROLE).equals(ctx.getUserRole());
|
||||
boolean externalTeam = KartConstant.EXTERNAL_TEAM.equals(ctx.getUserTeam());
|
||||
boolean externalId = userId != null && userId.startsWith(KartConstant.EXTERNAL_USER_PREFIX);
|
||||
if (!externalRole && !externalTeam && !externalId) {
|
||||
return true;
|
||||
@@ -59,7 +54,7 @@ public class ExternalAccessInterceptor implements HandlerInterceptor {
|
||||
link.pageOnly()
|
||||
? KartConstant.EXTERNAL_PAGE_COPY_ROLE
|
||||
: KartConstant.EXTERNAL_URL_COPY_ROLE;
|
||||
if (!Integer.valueOf(expectedRole).equals(claims.getUserRole())) {
|
||||
if (!Integer.valueOf(expectedRole).equals(ctx.getUserRole())) {
|
||||
throw denied();
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
@@ -76,6 +71,7 @@ public class ExternalAccessInterceptor implements HandlerInterceptor {
|
||||
String page = URI.create(link.realUrl()).getPath();
|
||||
boolean allowed = "/api/v1/log/visit".equals(pattern);
|
||||
if ("GET".equals(request.getMethod())) {
|
||||
allowed |= pattern.equals("/api/v1/project/{projectType}/{pkey}/access");
|
||||
allowed |=
|
||||
Set.of(
|
||||
"/api/v1/project/{projectType}/{pkey}/question/list",
|
||||
@@ -0,0 +1,58 @@
|
||||
package com.kri.kart.server.interceptor;
|
||||
|
||||
import com.kri.common.feature.web.BusinessException;
|
||||
import com.kri.common.feature.web.RequestUserContext;
|
||||
import com.kri.common.feature.web.RequestUserContextProvider;
|
||||
import com.kri.kart.server.common.consts.KartConstant;
|
||||
import com.kri.kart.server.common.enums.ProjectType;
|
||||
import com.kri.kart.server.dto.project.ProjectRefDto;
|
||||
import com.kri.kart.server.service.ProjectService;
|
||||
import jakarta.servlet.DispatcherType;
|
||||
import jakarta.servlet.http.HttpServletRequest;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import java.util.Map;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.servlet.HandlerInterceptor;
|
||||
import org.springframework.web.servlet.HandlerMapping;
|
||||
|
||||
@RequiredArgsConstructor
|
||||
public class ProjectAccessInterceptor implements HandlerInterceptor {
|
||||
private final RequestUserContextProvider requestUserContextProvider;
|
||||
private final ProjectService projectService;
|
||||
|
||||
@Override
|
||||
public boolean preHandle(
|
||||
HttpServletRequest request, HttpServletResponse response, Object handler) {
|
||||
// ExternalAccessInterceptor has already checked the stored project/page/API scope.
|
||||
if (request.getDispatcherType() == DispatcherType.ASYNC
|
||||
|| request.getAttribute(KartConstant.REQUEST_LINK_ATTRIBUTE) != null) {
|
||||
return true;
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, String> variables =
|
||||
(Map<String, String>) request.getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE);
|
||||
if (variables == null
|
||||
|| !variables.containsKey("projectType")
|
||||
|| !variables.containsKey("pkey")) {
|
||||
return true;
|
||||
}
|
||||
RequestUserContext ctx = requestUserContextProvider.resolve(request);
|
||||
if (!ctx.isAuthenticated()) {
|
||||
throw unauthenticated();
|
||||
}
|
||||
ProjectRefDto project;
|
||||
try {
|
||||
project = new ProjectRefDto(
|
||||
ProjectType.fromCode(Integer.valueOf(variables.get("projectType"))),
|
||||
variables.get("pkey"));
|
||||
} catch (IllegalArgumentException exception) {
|
||||
throw BusinessException.badRequest("projectType 또는 pkey가 올바르지 않습니다.");
|
||||
}
|
||||
projectService.requireAccess(project, ctx);
|
||||
return true;
|
||||
}
|
||||
|
||||
private BusinessException unauthenticated() {
|
||||
return BusinessException.unauthorized("PROJECT_IDENTITY_REQUIRED", "프로젝트 접근 인증 정보가 필요합니다.");
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,12 @@ import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface ProjectMapper {
|
||||
boolean hasAccess(
|
||||
@Param("pkey") String pkey,
|
||||
@Param("userRole") Integer userRole,
|
||||
@Param("authenticatedUserTeam") String authenticatedUserTeam,
|
||||
@Param("assignedPkeys") List<String> assignedPkeys);
|
||||
|
||||
List<ProjectListDto> list(
|
||||
@Param("userRole") Integer userRole,
|
||||
@Param("authenticatedUserTeam") String authenticatedUserTeam,
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.kri.kart.server.persistence.repository;
|
||||
|
||||
import com.kri.kart.server.common.enums.ProjectType;
|
||||
import com.kri.kart.server.dto.project.ProjectListDto;
|
||||
import com.kri.kart.server.dto.project.ProjectRefDto;
|
||||
import com.kri.kart.server.dto.project.ProjectSummaryDto;
|
||||
import com.kri.kart.server.persistence.SurveySessionProvider;
|
||||
import com.kri.kart.server.persistence.mapper.ProjectMapper;
|
||||
@@ -24,6 +25,12 @@ public class ProjectRepository {
|
||||
this.kartSqlSessionTemplate = kartSqlSessionTemplate;
|
||||
}
|
||||
|
||||
public boolean hasAccess(
|
||||
ProjectRefDto project, Integer userRole, String userTeam, List<String> assignedPkeys) {
|
||||
return surveySessionProvider.mapper(project, ProjectMapper.class)
|
||||
.hasAccess(project.pkey(), userRole, userTeam, assignedPkeys);
|
||||
}
|
||||
|
||||
public List<String> findMustViewPkeys(ProjectType type) {
|
||||
return kartSqlSessionTemplate.getMapper(ProjectMapper.class).mustViewPkeys(type.getCode());
|
||||
}
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.kri.kart.server.common.enums.ProjectType;
|
||||
import com.kri.kart.server.common.external.intranet.IntranetExtensionApiClient;
|
||||
import com.kri.kart.server.dto.project.ProjectLinkSearchDto;
|
||||
import com.kri.kart.server.dto.project.ProjectListDto;
|
||||
import com.kri.kart.server.dto.project.ProjectRefDto;
|
||||
import com.kri.kart.server.dto.project.ProjectSummaryDto;
|
||||
import com.kri.kart.server.persistence.repository.ProjectRepository;
|
||||
import java.util.ArrayList;
|
||||
@@ -112,6 +113,17 @@ public class ProjectService {
|
||||
return selected;
|
||||
}
|
||||
|
||||
public void requireAccess(ProjectRefDto project, RequestUserContext ctx) {
|
||||
requireIdentity(ctx);
|
||||
if (StringUtil.normalizeBlank(ctx.getUserId()) == null) {
|
||||
throw BusinessException.unauthorized("PROJECT_IDENTITY_REQUIRED", "프로젝트 접근 인증 정보가 부족합니다.");
|
||||
}
|
||||
if (!projectRepository.hasAccess(
|
||||
project, ctx.getUserRole(), ctx.getUserTeam(), assignedPkeys(ctx))) {
|
||||
throw BusinessException.forbidden("PROJECT_ACCESS_DENIED", "프로젝트에 접근할 권한이 없습니다.");
|
||||
}
|
||||
}
|
||||
|
||||
private void requireIdentity(RequestUserContext ctx) {
|
||||
if (ctx.getUserRole() == null
|
||||
|| (!Integer.valueOf(1001).equals(ctx.getUserRole())
|
||||
|
||||
@@ -39,6 +39,12 @@
|
||||
</if>
|
||||
<include refid="assignmentVisibility"/>
|
||||
</sql>
|
||||
<select id="hasAccess" databaseId="survey" resultType="boolean">
|
||||
SELECT CASE WHEN EXISTS (
|
||||
SELECT 1 FROM PROJECT WHERE PKEY = #{pkey}
|
||||
<include refid="listVisibility"/>
|
||||
) THEN 1 ELSE 0 END
|
||||
</select>
|
||||
<select id="list" databaseId="survey" resultType="com.kri.kart.server.dto.project.ProjectListDto">
|
||||
SELECT PKEY, <if test="projectType == 1">'KIWI - ' + </if>
|
||||
<![CDATA[
|
||||
|
||||
Reference in New Issue
Block a user