Search in sources :

Example 6 with AssignmentsPreviewDto

use of com.evolveum.midpoint.web.page.admin.users.component.AssignmentsPreviewDto in project midpoint by Evolveum.

the class AssignmentEditorDto method setPrivilegeLimitationList.

public void setPrivilegeLimitationList(List<AssignmentsPreviewDto> privilegeLimitationList) {
    if (newAssignment.getLimitTargetContent() == null) {
        newAssignment.setLimitTargetContent(new AssignmentSelectorType());
    }
    List<ObjectReferenceType> referencesList = newAssignment.getLimitTargetContent().getTargetRef();
    if (referencesList == null) {
        referencesList = new ArrayList<>();
    }
    referencesList.clear();
    for (AssignmentsPreviewDto previewDto : privilegeLimitationList) {
        ObjectReferenceType ref = new ObjectReferenceType();
        ref.setOid(previewDto.getTargetOid());
        ref.setTargetName(new PolyStringType(previewDto.getTargetName()));
        ref.setType(previewDto.getTargetType());
        ref.setRelation(previewDto.getRelation());
        referencesList.add(ref);
    }
    this.privilegeLimitationList = privilegeLimitationList;
}
Also used : PolyStringType(com.evolveum.prism.xml.ns._public.types_3.PolyStringType) AssignmentsPreviewDto(com.evolveum.midpoint.web.page.admin.users.component.AssignmentsPreviewDto)

Example 7 with AssignmentsPreviewDto

use of com.evolveum.midpoint.web.page.admin.users.component.AssignmentsPreviewDto in project midpoint by Evolveum.

the class PageUser method getUserPrivilegesList.

private List<AssignmentsPreviewDto> getUserPrivilegesList() {
    List<AssignmentsPreviewDto> list = new ArrayList<>();
    OperationResult result = new OperationResult(OPERATION_LOAD_ASSIGNMENT_PEVIEW_DTO_LIST);
    Task task = createSimpleTask(OPERATION_LOAD_ASSIGNMENT_PEVIEW_DTO_LIST);
    for (AssignmentType assignment : getObjectWrapper().getObject().asObjectable().getAssignment()) {
        AssignmentsPreviewDto dto = createDelegableAssignmentsPreviewDto(assignment, task, result);
        if (dto != null) {
            list.add(dto);
        }
    }
    return list;
}
Also used : Task(com.evolveum.midpoint.task.api.Task) AssignmentsPreviewDto(com.evolveum.midpoint.web.page.admin.users.component.AssignmentsPreviewDto) OperationResult(com.evolveum.midpoint.schema.result.OperationResult)

Aggregations

AssignmentsPreviewDto (com.evolveum.midpoint.web.page.admin.users.component.AssignmentsPreviewDto)7 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)3 Task (com.evolveum.midpoint.task.api.Task)2 ArrayList (java.util.ArrayList)2 EvaluatedAssignmentTarget (com.evolveum.midpoint.model.api.context.EvaluatedAssignmentTarget)1 EvaluatedConstruction (com.evolveum.midpoint.model.api.context.EvaluatedConstruction)1 PolyStringType (com.evolveum.prism.xml.ns._public.types_3.PolyStringType)1