|
|
@ -440,12 +440,6 @@ public class PantheonCommand implements DefaultCommandValues, Runnable { |
|
|
|
description = "Enable account level permissions (default: ${DEFAULT-VALUE})") |
|
|
|
description = "Enable account level permissions (default: ${DEFAULT-VALUE})") |
|
|
|
private final Boolean permissionsAccountsEnabled = false; |
|
|
|
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( |
|
|
|
@Option( |
|
|
|
names = {"--privacy-enabled"}, |
|
|
|
names = {"--privacy-enabled"}, |
|
|
|
description = "Enable private transactions (default: ${DEFAULT-VALUE})") |
|
|
|
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>)"); |
|
|
|
+ "or specify the beneficiary of mining (via --miner-coinbase <Address>)"); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (permissionsConfigFile != null) { |
|
|
|
if (permissionsConfigFile() != null) { |
|
|
|
if (!permissionsAccountsEnabled && !permissionsNodesEnabled) { |
|
|
|
if (!permissionsAccountsEnabled && !permissionsNodesEnabled) { |
|
|
|
logger.warn( |
|
|
|
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() { |
|
|
|
private String getPermissionsConfigFile() { |
|
|
|
|
|
|
|
|
|
|
|
return permissionsConfigFile != null |
|
|
|
return permissionsConfigFile() != null |
|
|
|
? permissionsConfigFile |
|
|
|
? permissionsConfigFile() |
|
|
|
: dataDir().toAbsolutePath() |
|
|
|
: dataDir().toAbsolutePath() |
|
|
|
+ System.getProperty("file.separator") |
|
|
|
+ System.getProperty("file.separator") |
|
|
|
+ DefaultCommandValues.PERMISSIONING_CONFIG_LOCATION; |
|
|
|
+ DefaultCommandValues.PERMISSIONING_CONFIG_LOCATION; |
|
|
@ -1008,6 +1002,20 @@ public class PantheonCommand implements DefaultCommandValues, Runnable { |
|
|
|
return filename; |
|
|
|
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() { |
|
|
|
private boolean isFullInstantiation() { |
|
|
|
return !isDocker; |
|
|
|
return !isDocker; |
|
|
|
} |
|
|
|
} |
|
|
|