Skip to content

Commit

Permalink
Merge pull request #3965 from Cousjava/PAYARA-3703-update-file-user-f…
Browse files Browse the repository at this point in the history
…ails

PAYARA-3703 Update-file-users command now works when there are instances with different configs
  • Loading branch information
Cousjava authored May 22, 2019
2 parents 1ae215b + 366c0c3 commit 96bb0b4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
holder.

-->
<!-- Portions Copyright [2019] Payara Foundation and/or affiliates -->

<!initPage
setResourceBundle(key="i18nc" bundle="org.glassfish.common.admingui.Strings")
Expand All @@ -57,7 +58,7 @@
method="get", result="#{requestScope.listUsersResult}");
setPageSessionAttribute(key="listOfRows", value="#{requestScope.listUsersResult.data.extraProperties.users}");
gf.restRequest(endpoint="#{sessionScope.REST_URL}/configs/config/#{pageSession.configName}/admin-service/jmx-connector/system.json", method="get", result="#{requestScope.result}");
setPageSessionAttribute(key="AuthRealmName" value="#{requestScope.result.entity['authRealmName']");
setPageSessionAttribute(key="AuthRealmName" value="#{requestScope.result.entity['authRealmName']}");
if ("#{pageSession.Name}=#{pageSession.authRealm}"){
setPageSessionAttribute(key="tableTitle", value="$resource{i18nc.manageAdminUsers.TableTitle}")
setPageSessionAttribute(key="helpKey", value="$resource{help_common.manageAdminUsers}" )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2018] [Payara Foundation and/or its affiliates]
// Portions Copyright [2018-2019] [Payara Foundation and/or its affiliates]
package com.sun.enterprise.security.cli;

import com.sun.enterprise.config.serverbeans.AdminService;
Expand Down Expand Up @@ -76,6 +76,7 @@
import java.beans.PropertyVetoException;
import java.io.File;
import org.glassfish.api.admin.*;
import org.glassfish.config.support.CommandTarget;
import org.glassfish.config.support.TargetType;
import org.jvnet.hk2.config.ConfigSupport;
import org.jvnet.hk2.config.SingleConfigCode;
Expand All @@ -95,8 +96,8 @@
@Service(name = "create-file-user")
@PerLookup
@I18n("create.file.user")
@ExecuteOn({ RuntimeType.ALL })
@TargetType({ DAS, STANDALONE_INSTANCE, CLUSTER, CONFIG })
@ExecuteOn({ RuntimeType.INSTANCE, RuntimeType.DAS })
@TargetType({ DAS, STANDALONE_INSTANCE, CLUSTER, CONFIG, CommandTarget.DEPLOYMENT_GROUP })
@RestEndpoints({
@RestEndpoint(configBean = AuthRealm.class, opType = RestEndpoint.OpType.POST, path = "create-user", description = "Create", params = {
@RestParam(name = "authrealmname", value = "$parent") }) })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2018] [Payara Foundation and/or its affiliates]
// Portions Copyright [2018-2019] [Payara Foundation and/or its affiliates]
package com.sun.enterprise.security.cli;

import java.beans.PropertyVetoException;
Expand Down Expand Up @@ -90,8 +90,8 @@
@Service(name = "delete-file-user")
@PerLookup
@I18n("delete.file.user")
@ExecuteOn({ RuntimeType.ALL })
@TargetType({ CommandTarget.DAS, CommandTarget.STANDALONE_INSTANCE, CommandTarget.CLUSTER, CommandTarget.CONFIG })
@ExecuteOn({ RuntimeType.DAS, RuntimeType.INSTANCE })
@TargetType({ CommandTarget.DAS, CommandTarget.STANDALONE_INSTANCE, CommandTarget.CLUSTER, CommandTarget.CONFIG, CommandTarget.DEPLOYMENT_GROUP })
@RestEndpoints({
@RestEndpoint(configBean = AuthRealm.class, opType = RestEndpoint.OpType.DELETE, path = "delete-user", description = "Delete", params = {
@RestParam(name = "authrealmname", value = "$parent") }) })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2018] [Payara Foundation and/or its affiliates]
// Portions Copyright [2018-2019] [Payara Foundation and/or its affiliates]
package com.sun.enterprise.security.cli;

import org.glassfish.api.admin.RuntimeType;
import static org.glassfish.api.admin.RestEndpoint.OpType.POST;
import static org.glassfish.api.admin.RuntimeType.ALL;
import static org.glassfish.config.support.CommandTarget.CLUSTER;
import static org.glassfish.config.support.CommandTarget.CONFIG;
import static org.glassfish.config.support.CommandTarget.DAS;
Expand Down Expand Up @@ -81,6 +81,7 @@
import com.sun.enterprise.security.auth.realm.file.FileRealm;
import com.sun.enterprise.util.LocalStringManagerImpl;
import com.sun.enterprise.util.SystemPropertyConstants;
import org.glassfish.config.support.CommandTarget;

/**
* Update File User Command
Expand All @@ -95,8 +96,8 @@
@Service(name = "update-file-user")
@PerLookup
@I18n("update.file.user")
@ExecuteOn({ ALL })
@TargetType({ DAS, STANDALONE_INSTANCE, CLUSTER, CONFIG })
@ExecuteOn({ RuntimeType.INSTANCE, RuntimeType.DAS })
@TargetType({ DAS, STANDALONE_INSTANCE, CLUSTER, CONFIG, CommandTarget.DEPLOYMENT_GROUP })
@RestEndpoints({
@RestEndpoint(configBean = AuthRealm.class, opType = POST, path = "update-user", description = "Update Users",
params = { @RestParam(name = "authrealmname", value = "$parent") }) })
Expand Down

0 comments on commit 96bb0b4

Please sign in to comment.