|
|
|
@ -440,12 +440,6 @@ public class PantheonCommand implements DefaultCommandValues, Runnable { |
|
|
|
|
description = "Enable account level permissions (default: ${DEFAULT-VALUE})") |
|
|
|
|
private final Boolean permissionsAccountsEnabled = false; |
|
|
|
|
|
|
|
|
|
@Option( |
|
|
|
|
names = {"--permissions-config-file"}, |
|
|
|
|
description = |
|
|
|
|
"Permissions config TOML file (default: a file named \"permissions_config.toml\" in the Pantheon data folder)") |
|
|
|
|
private String permissionsConfigFile = null; |
|
|
|
|
|
|
|
|
|
@Option( |
|
|
|
|
names = {"--privacy-enabled"}, |
|
|
|
|
description = "Enable private transactions (default: ${DEFAULT-VALUE})") |
|
|
|
@ -550,10 +544,10 @@ public class PantheonCommand implements DefaultCommandValues, Runnable { |
|
|
|
|
+ "or specify the beneficiary of mining (via --miner-coinbase <Address>)"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (permissionsConfigFile != null) { |
|
|
|
|
if (permissionsConfigFile() != null) { |
|
|
|
|
if (!permissionsAccountsEnabled && !permissionsNodesEnabled) { |
|
|
|
|
logger.warn( |
|
|
|
|
"Permissions config file set {} but no permissions enabled", permissionsConfigFile); |
|
|
|
|
"Permissions config file set {} but no permissions enabled", permissionsConfigFile()); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -622,8 +616,8 @@ public class PantheonCommand implements DefaultCommandValues, Runnable { |
|
|
|
|
|
|
|
|
|
private String getPermissionsConfigFile() { |
|
|
|
|
|
|
|
|
|
return permissionsConfigFile != null |
|
|
|
|
? permissionsConfigFile |
|
|
|
|
return permissionsConfigFile() != null |
|
|
|
|
? permissionsConfigFile() |
|
|
|
|
: dataDir().toAbsolutePath() |
|
|
|
|
+ System.getProperty("file.separator") |
|
|
|
|
+ DefaultCommandValues.PERMISSIONING_CONFIG_LOCATION; |
|
|
|
@ -1008,6 +1002,20 @@ public class PantheonCommand implements DefaultCommandValues, Runnable { |
|
|
|
|
return filename; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private String permissionsConfigFile() { |
|
|
|
|
String filename = null; |
|
|
|
|
if (isFullInstantiation()) { |
|
|
|
|
filename = standaloneCommands.permissionsConfigFile; |
|
|
|
|
} else if (isDocker) { |
|
|
|
|
final File file = new File(DOCKER_PERMISSIONS_CONFIG_FILE_LOCATION); |
|
|
|
|
if (file.exists()) { |
|
|
|
|
filename = file.getAbsolutePath(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return filename; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean isFullInstantiation() { |
|
|
|
|
return !isDocker; |
|
|
|
|
} |
|
|
|
|