refs #707: enforce HMM leave team VPD
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
package com.cloudhandson.vpdbackoffice.domain.permission;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class PermissionViewTest {
|
||||
|
||||
@Test
|
||||
void translatesHmmLeaveScopeRulesForBackofficeUsers() {
|
||||
PermissionView view = new PermissionView(
|
||||
1L,
|
||||
2L,
|
||||
"HMM_HR_MANAGER",
|
||||
10L,
|
||||
"HMM_LEAVE_REQUESTS",
|
||||
"SELECT",
|
||||
"ALLOW",
|
||||
"EMPLOYEE_ID MANAGED_TEAM,EMPLOYEE_ID SELF",
|
||||
null,
|
||||
null,
|
||||
null
|
||||
);
|
||||
|
||||
assertThat(view.businessRuleSummary())
|
||||
.contains("본인 및 직접 보고 팀원 행")
|
||||
.contains("본인 직원 행");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.cloudhandson.vpdbackoffice.domain.vpd;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import java.util.List;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class VpdPolicyFormOptionsTest {
|
||||
|
||||
@Test
|
||||
void choosesHmmFilterForHmmLeaveObjects() {
|
||||
VpdPolicyFormOptions options = new VpdPolicyFormOptions(
|
||||
List.of(),
|
||||
List.of(),
|
||||
List.of(),
|
||||
List.of(
|
||||
new VpdFunctionOption("ADMIN", null, "CB_AGENT_DOC_VPD_FILTER", "FUNCTION"),
|
||||
new VpdFunctionOption("ADMIN", null, "HMM_LEAVE_VPD_FILTER", "FUNCTION")
|
||||
),
|
||||
List.of(),
|
||||
List.of("SELECT")
|
||||
);
|
||||
|
||||
assertThat(options.defaultPermissionFunctionKey("HMM_LEAVE_BALANCES"))
|
||||
.isEqualTo("ADMIN.HMM_LEAVE_VPD_FILTER");
|
||||
assertThat(options.defaultPermissionFunctionKey("HMM_LEAVE_REQUESTS"))
|
||||
.isEqualTo("ADMIN.HMM_LEAVE_VPD_FILTER");
|
||||
assertThat(options.defaultPermissionFunctionKey("CB_AGENT_DOCUMENTS"))
|
||||
.isEqualTo("ADMIN.CB_AGENT_DOC_VPD_FILTER");
|
||||
}
|
||||
}
|
||||
@@ -184,8 +184,10 @@ class GuidedFlowTemplateTest {
|
||||
String javascript = Files.readString(Path.of("src/main/resources/static/js/app.js"));
|
||||
|
||||
assertThat(html)
|
||||
.contains("value=\"OWN_CUSTOMER\">본인 담당 고객")
|
||||
.contains("value=\"MANAGED_TEAM\">본인 및 직접 보고 팀원")
|
||||
.contains("value=\"SELF\">본인 직원 행")
|
||||
.contains("value=\"STATIC_SQL\">정적 SQL 조건식")
|
||||
.contains("HMM_LEAVE_VPD_FILTER")
|
||||
.contains("행 규칙의 두 가지 적용 방식 보기")
|
||||
.contains("한 권한 안의 규칙은 모두 AND")
|
||||
.contains("서로 다른 역할의 ALLOW 권한은 OR")
|
||||
|
||||
Reference in New Issue
Block a user