result = (embeddedSystemAdministrator.matches(subject)) || checkAccessRequired(subject, env, command, accessChecks);
/** * Runs a command from somewhere OTHER THAN an already-running, * previously-authorized command. * <p> * If a command is already running then it should have a valid Subject and * that Subject must be used in running a nested command. This * method uses the internal system admin identity to authorize the command to be run and * this should never be done if a user has authenticated to the system * and is running a separate, already-authorized command. This method * is, therefore, used from some embedded functionality. * * @param command * @param args * @return * @throws CommandException */ /* package */ ActionReport executeCommand(String command, String... args) throws CommandException { ParameterMap commandParams = getParameters(command, args); final ActionReport actionReport = createActionReport(); org.glassfish.api.admin.CommandRunner.CommandInvocation inv = commandRunner.getCommandInvocation(command, actionReport, embeddedSystemAdministrator.getSubject(),false); inv.parameters(commandParams).execute(); return actionReport; }