Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Evolveum/midpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Apr 3, 2023
2 parents ec1b808 + 7c23029 commit a7706a3
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ public void onClick(AjaxRequestTarget target) {
return importObject;
}

private boolean isImportObjectButtonVisible() {
protected boolean isImportObjectButtonVisible() {
try {
return ((PageBase) getPage()).isAuthorized(ModelAuthorizationAction.IMPORT_OBJECTS.getUrl())
&& WebComponentUtil.isAuthorized(AuthorizationConstants.AUTZ_UI_CONFIGURATION_ALL_URL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,9 @@ public static String getReferencedObjectDisplayNamesAndNames(Referencable ref, b
}
String name = ref.getTargetName() == null ? "" :
(translate ? ref.getTargetName().getOrig() : "");
if (StringUtils.isEmpty(name)) {
name = ref.getOid();
}
StringBuilder sb = new StringBuilder(name);
if (showTypes) {
sb.append(" (");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ protected Iterator<? extends PrismContainerValueWrapper<C>> doRepositoryIteratio

if (!WebComponentUtil.isSuccessOrHandledError(result)) {
getPageBase().showResult(result);
throw new RestartResponseException(PageError.class);
}

LOGGER.trace("end::iterator()");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -409,11 +409,11 @@ private MainMenuItem createResourcesItems() {
MainMenuItem resourceMenu = createMainMenuItem(
"PageAdmin.menu.top.resources", GuiStyleConstants.CLASS_OBJECT_RESOURCE_ICON_COLORED);

resourceMenu.addMenuItem(new MenuItem("PageAdmin.menu.top.resource.templates.list",
GuiStyleConstants.CLASS_OBJECT_RESOURCE_ICON, PageResourceTemplates.class));

createBasicAssignmentHolderMenuItems(resourceMenu, PageTypes.RESOURCE);

resourceMenu.addMenuItemAtIndex(new MenuItem("PageAdmin.menu.top.resource.templates.list",
GuiStyleConstants.CLASS_OBJECT_RESOURCE_ICON, PageResourceTemplates.class),1);

resourceMenu.addMenuItem(new MenuItem("PageAdmin.menu.top.resources.import", PageImportResource.class));
resourceMenu.addMenuItem(new MenuItem("PageAdmin.menu.top.connectorHosts.list", PageConnectorHosts.class));
return resourceMenu;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,12 @@ protected String getTitleForNewObjectButton() {

@Override
protected boolean isCreateNewObjectVisible() {
return isAuthorized(GuiAuthorizationConstants.MEMBER_OPERATION_CREATE);
return false;
}

@Override
protected boolean isImportObjectButtonVisible() {
return false;
}
};
childrenListPanel.setOutputMarkupId(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ private List<WizardStep> createBasicSteps() {
public VisibleEnableBehaviour getBackBehaviour() {
return VisibleEnableBehaviour.ALWAYS_INVISIBLE;
}

@Override
protected void onExitPerformed(AjaxRequestTarget target) {
BusinessRoleWizardPanel.this.onExitPerformed(target);
}
});

steps.add(new AccessApplicationRoleStepPanel(getHelper().getDetailsModel()){
Expand All @@ -55,6 +60,11 @@ protected void onSubmitPerformed(AjaxRequestTarget target) {
super.onSubmitPerformed(target);
BusinessRoleWizardPanel.this.onFinishBasicWizardPerformed(target);
}

@Override
protected void onExitPerformed(AjaxRequestTarget target) {
BusinessRoleWizardPanel.this.onExitPerformed(target);
}
});

return steps;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public void onClick(AjaxRequestTarget ajaxRequestTarget) {
return false;
}

return ref.getOid() != null;
return ref.getObject() != null;
}));
add(nameLink);

Expand All @@ -129,6 +129,9 @@ public void onClick(AjaxRequestTarget ajaxRequestTarget) {
if (ref == null) {
return "";
}
if (ref.getTargetName() == null && ref.getObject()== null) {
return WebComponentUtil.getReferencedObjectDisplayNamesAndNames(ref.asReferencable(), true, true);
}
return WebComponentUtil.getReferencedObjectDisplayNameAndName(ref.asReferencable(), false, getPageBase());
});
nameLinkText.setRenderBodyOnly(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ public void addMenuItem(MenuItem menuItem) {
}
}

public void addMenuItemAtIndex(MenuItem menuItem, int position) {
if (SecurityUtils.isMenuAuthorized(menuItem)) {
if (getItems().size() >= position) {
getItems().add(position, menuItem);
}else {
getItems().add(menuItem);
}
}
}

public void addCollectionMenuItem(MenuItem menuItem) {
if (SecurityUtils.isCollectionMenuAuthorized(menuItem)) {
getItems().add(menuItem);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2478,8 +2478,6 @@
</xsd:documentation>
<xsd:appinfo>
<a:operational>true</a:operational>
<a:deprecated>true</a:deprecated>
<a:deprecatedSince>4.7</a:deprecatedSince>
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
Expand Down

0 comments on commit a7706a3

Please sign in to comment.