use of com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType in project midpoint by Evolveum.
the class TestRbac method test815ModifyRoleImmutableGlobalDescription.
@Test
public void test815ModifyRoleImmutableGlobalDescription() throws Exception {
final String TEST_NAME = "test815ModifyRoleImmutableGlobalDescription";
TestUtil.displayTestTile(this, TEST_NAME);
assumeAssignmentPolicy(AssignmentPolicyEnforcementType.FULL);
Task task = taskManager.createTaskInstance(TestRbac.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
try {
// WHEN
TestUtil.displayWhen(TEST_NAME);
modifyObjectReplaceProperty(RoleType.class, ROLE_IMMUTABLE_DESCRIPTION_GLOBAL_OID, RoleType.F_DESCRIPTION, task, result, "whatever");
AssertJUnit.fail("Unexpected success");
} catch (PolicyViolationException e) {
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertFailure(result);
}
PrismObject<RoleType> roleAfter = getObject(RoleType.class, ROLE_IMMUTABLE_DESCRIPTION_GLOBAL_OID);
PrismAsserts.assertPropertyValue(roleAfter, RoleType.F_DESCRIPTION, ROLE_IMMUTABLE_DESCRIPTION_GLOBAL_DESCRIPTION);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType in project midpoint by Evolveum.
the class TestRbac method test800ModifyRoleImmutable.
@Test
public void test800ModifyRoleImmutable() throws Exception {
final String TEST_NAME = "test800ModifyRoleImmutable";
TestUtil.displayTestTile(this, TEST_NAME);
assumeAssignmentPolicy(AssignmentPolicyEnforcementType.FULL);
Task task = taskManager.createTaskInstance(TestRbac.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
try {
// WHEN
TestUtil.displayWhen(TEST_NAME);
modifyObjectReplaceProperty(RoleType.class, ROLE_IMMUTABLE_OID, RoleType.F_DESCRIPTION, task, result, "whatever");
AssertJUnit.fail("Unexpected success");
} catch (PolicyViolationException e) {
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertFailure(result);
}
PrismObject<RoleType> roleAfter = getObject(RoleType.class, ROLE_IMMUTABLE_OID);
PrismAsserts.assertPropertyValue(roleAfter, RoleType.F_DESCRIPTION, ROLE_IMMUTABLE_DESCRIPTION);
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType in project midpoint by Evolveum.
the class TestRbac method test828ModifyUntouchableMetarole.
/**
* The untouchable metarole has immutable policy rule in the
* inducement. So it will apply to member roles, but not to the
* metarole itself. Try if we can modify the metarole.
*/
@Test
public void test828ModifyUntouchableMetarole() throws Exception {
final String TEST_NAME = "test828ModifyUntouchableMetarole";
TestUtil.displayTestTile(this, TEST_NAME);
assumeAssignmentPolicy(AssignmentPolicyEnforcementType.FULL);
Task task = taskManager.createTaskInstance(TestRbac.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
// WHEN
TestUtil.displayWhen(TEST_NAME);
modifyObjectReplaceProperty(RoleType.class, ROLE_META_UNTOUCHABLE_OID, RoleType.F_DESCRIPTION, task, result, "Touche!");
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertSuccess(result);
PrismObject<RoleType> roleAfter = getObject(RoleType.class, ROLE_META_UNTOUCHABLE_OID);
PrismAsserts.assertPropertyValue(roleAfter, RoleType.F_DESCRIPTION, "Touche!");
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType in project midpoint by Evolveum.
the class TestRbac method test830ModifyRoleJudge.
@Test
public void test830ModifyRoleJudge() throws Exception {
final String TEST_NAME = "test830ModifyRoleJudge";
TestUtil.displayTestTile(this, TEST_NAME);
assumeAssignmentPolicy(AssignmentPolicyEnforcementType.FULL);
Task task = taskManager.createTaskInstance(TestRbac.class.getName() + "." + TEST_NAME);
OperationResult result = task.getResult();
// WHEN
TestUtil.displayWhen(TEST_NAME);
modifyObjectReplaceProperty(RoleType.class, ROLE_JUDGE_OID, RoleType.F_DESCRIPTION, task, result, "whatever");
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertSuccess(result);
PrismObject<RoleType> roleAfter = getObject(RoleType.class, ROLE_JUDGE_OID);
PrismAsserts.assertPropertyValue(roleAfter, RoleType.F_DESCRIPTION, "whatever");
}
use of com.evolveum.midpoint.xml.ns._public.common.common_3.RoleType in project midpoint by Evolveum.
the class TestRbac method test855JackModifyFoolMetaroleDeleteInducement.
@Test
public void test855JackModifyFoolMetaroleDeleteInducement() throws Exception {
final String TEST_NAME = "test855JackModifyFoolMetaroleDeleteInducement";
TestUtil.displayTestTile(this, TEST_NAME);
assumeAssignmentPolicy(AssignmentPolicyEnforcementType.FULL);
Task task = taskManager.createTaskInstance(TestRbac.class.getName() + "." + TEST_NAME);
task.setOwner(getUser(USER_ADMINISTRATOR_OID));
OperationResult result = task.getResult();
PrismObject<RoleType> roleBefore = getObject(RoleType.class, ROLE_META_FOOL_OID);
display("Role meta fool before", roleBefore);
assertInducements(roleBefore, 2);
// WHEN
TestUtil.displayWhen(TEST_NAME);
modifyRoleDeleteInducement(ROLE_META_FOOL_OID, 10002L, false, task);
// THEN
TestUtil.displayThen(TEST_NAME);
result.computeStatus();
TestUtil.assertSuccess(result);
PrismObject<RoleType> roleAfter = getObject(RoleType.class, ROLE_META_FOOL_OID);
display("Role meta fool after", roleAfter);
assertInducements(roleAfter, 1);
}
Aggregations