You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2020/01/30 07:42:15 UTC
[syncope] branch master updated: [SYNCOPE-1531] Ensure proper auth
checks for CSV push / pull
This is an automated email from the ASF dual-hosted git repository.
ilgrosso pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git
The following commit(s) were added to refs/heads/master by this push:
new 1578ba6 [SYNCOPE-1531] Ensure proper auth checks for CSV push / pull
1578ba6 is described below
commit 1578ba679a81216532d526c1f9b7d7b1c0a9807d
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Thu Jan 30 08:40:47 2020 +0100
[SYNCOPE-1531] Ensure proper auth checks for CSV push / pull
---
.../commons/IdMAnyDirectoryPanelAdditionalActionsProvider.java | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/client/idm/console/src/main/java/org/apache/syncope/client/console/commons/IdMAnyDirectoryPanelAdditionalActionsProvider.java b/client/idm/console/src/main/java/org/apache/syncope/client/console/commons/IdMAnyDirectoryPanelAdditionalActionsProvider.java
index 43eafc3..d184720 100644
--- a/client/idm/console/src/main/java/org/apache/syncope/client/console/commons/IdMAnyDirectoryPanelAdditionalActionsProvider.java
+++ b/client/idm/console/src/main/java/org/apache/syncope/client/console/commons/IdMAnyDirectoryPanelAdditionalActionsProvider.java
@@ -37,12 +37,15 @@ import org.apache.syncope.client.console.wizards.any.ResultPage;
import org.apache.syncope.client.ui.commons.Constants;
import org.apache.syncope.client.ui.commons.wizards.AjaxWizard;
import org.apache.syncope.common.lib.to.ProvisioningReport;
+import org.apache.syncope.common.lib.types.IdRepoEntitlement;
import org.apache.syncope.common.rest.api.beans.AnyQuery;
import org.apache.syncope.common.rest.api.beans.CSVPullSpec;
import org.apache.syncope.common.rest.api.beans.CSVPushSpec;
+import org.apache.wicket.Component;
import org.apache.wicket.PageReference;
import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.markup.html.AjaxLink;
+import org.apache.wicket.authroles.authorization.strategies.role.metadata.MetaDataRoleAuthorizationStrategy;
import org.apache.wicket.event.IEvent;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.panel.Panel;
@@ -141,6 +144,8 @@ public class IdMAnyDirectoryPanelAdditionalActionsProvider implements AnyDirecto
modal.show(true);
}
};
+ MetaDataRoleAuthorizationStrategy.authorize(csvPushLink, Component.RENDER,
+ String.format("%s,%s", IdRepoEntitlement.IMPLEMENTATION_LIST, IdRepoEntitlement.TASK_EXECUTE));
panel.addInnerObject(csvPushLink.setOutputMarkupId(true).setOutputMarkupPlaceholderTag(true));
csvPullLink = new AjaxLink<Void>("csvPull") {
@@ -158,6 +163,8 @@ public class IdMAnyDirectoryPanelAdditionalActionsProvider implements AnyDirecto
modal.show(true);
}
};
+ MetaDataRoleAuthorizationStrategy.authorize(csvPullLink, Component.RENDER,
+ String.format("%s,%s", IdRepoEntitlement.IMPLEMENTATION_LIST, IdRepoEntitlement.TASK_EXECUTE));
panel.addInnerObject(csvPullLink.setOutputMarkupId(true).setOutputMarkupPlaceholderTag(true));
}