Skip to content

Commit

Permalink
Fix MID-8571 resource oid/name conversion on My Accesses widget.
Browse files Browse the repository at this point in the history
  • Loading branch information
tchrapovic committed Mar 9, 2023
1 parent 1e00088 commit 08fab73
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1191,8 +1191,6 @@ public static <O extends ObjectType> String getName(ObjectReferenceType ref, Pag
String name = getName(ref);
if (StringUtils.isEmpty(name) || name.equals(ref.getOid())) {
String oid = ref.getOid();
Collection<SelectorOptions<GetOperationOptions>> options = SelectorOptions
.createCollection(GetOperationOptions.createNoFetch());
Class<O> type = (Class<O>) ObjectType.class;
PrismObject<O> object = WebModelServiceUtils.loadObject(type, oid, pageBase,
pageBase.createSimpleTask(operation), new OperationResult(operation));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,12 @@
public class AssignmentsUtil {

public enum AssignmentTypeType {
CONSTRUCTION, ABSTRACT_ROLE, POLICY_RULE, FOCUS_MAPPING, PERSONA_CONSTRUCTION, ASSIGNMENT_RELATION;
CONSTRUCTION, ABSTRACT_ROLE, POLICY_RULE, FOCUS_MAPPING, PERSONA_CONSTRUCTION, ASSIGNMENT_RELATION
}

private static final Trace LOGGER = TraceManager.getTrace(AssignmentsUtil.class);
private static final String DOT_CLASS = AssignmentsUtil.class.getSimpleName() + ".";
private static final String OPERATION_LOAD_USER = DOT_CLASS + "loadObject";

public static AssignmentTypeType getAssignmentType(PrismContainerValueWrapper<AssignmentType> assignmentValueWrapper) {
if (assignmentValueWrapper == null) {
Expand Down Expand Up @@ -168,7 +170,7 @@ private static IModel<String> createTimeIntervalStatusMessage(TimeIntervalStatus
}

public static IModel<Date> createDateModel(final IModel<XMLGregorianCalendar> model) {
return new Model<Date>() {
return new Model<>() {

@Override
public Date getObject() {
Expand All @@ -191,7 +193,7 @@ public void setObject(Date object) {
}

public static IModel<String> createAssignmentStatusClassModel(final UserDtoStatus model) {
return new IModel<String>() {
return new IModel<>() {
private static final long serialVersionUID = 1L;

@Override
Expand All @@ -202,7 +204,7 @@ public String getObject() {
}

public static IModel<String> createAssignmentIconTitleModel(BasePanel panel, AssignmentEditorDtoType type) {
return new IModel<String>() {
return new IModel<>() {
private static final long serialVersionUID = 1L;

@Override
Expand Down Expand Up @@ -276,7 +278,7 @@ public static String getName(AssignmentType assignment, PageBase pageBase) {
// account assignment through account construction
ConstructionType construction = assignment.getConstruction();
if (construction.getResourceRef() != null) {
sb.append(WebComponentUtil.getName(construction.getResourceRef(), true));
sb.append(WebComponentUtil.getName(construction.getResourceRef(), pageBase, OPERATION_LOAD_USER));
}
return sb.toString();
}
Expand Down

0 comments on commit 08fab73

Please sign in to comment.