[Developer] #619 map VPD rules to token context variables
This commit is contained in:
@@ -175,8 +175,8 @@ class PermissionServiceTest {
|
||||
"SELECT",
|
||||
"ALLOW",
|
||||
List.of(
|
||||
new RuleCommand("DEPT_CODE", "STAKEHOLDER_SELF", null),
|
||||
new RuleCommand("OWNER_EMP_NO", "STAKEHOLDER_CHANNEL", null)
|
||||
new RuleCommand("DEPT_CODE", "STAKEHOLDER_SELF", "설계사"),
|
||||
new RuleCommand("OWNER_EMP_NO", "STAKEHOLDER_CHANNEL", "지점장")
|
||||
),
|
||||
List.of()
|
||||
);
|
||||
@@ -205,6 +205,22 @@ class PermissionServiceTest {
|
||||
.hasMessageContaining("컬럼이 필요");
|
||||
}
|
||||
|
||||
@Test
|
||||
void rejectsStakeholderContextRuleWithoutExpectedRole() {
|
||||
var command = new PermissionSetCommand(
|
||||
10L,
|
||||
1L,
|
||||
"SELECT",
|
||||
"ALLOW",
|
||||
List.of(new RuleCommand("DEPT_CODE", "STAKEHOLDER_SELF", null)),
|
||||
List.of()
|
||||
);
|
||||
|
||||
assertThatThrownBy(() -> permissionService.savePermissionSet(command))
|
||||
.isInstanceOf(AppException.class)
|
||||
.hasMessageContaining("값이 필요");
|
||||
}
|
||||
|
||||
@Test
|
||||
void acceptsMultipleVisibleColumns() {
|
||||
var command = new PermissionSetCommand(
|
||||
|
||||
Reference in New Issue
Block a user