Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
set_action_permission_subcommand Struct Reference

Public Member Functions

 set_action_permission_subcommand (CLI::App *actionRoot)
 

Public Attributes

string accountStr
 
string codeStr
 
string typeStr
 
string requirementStr
 

Detailed Description

Definition at line 978 of file main.cpp.

Constructor & Destructor Documentation

◆ set_action_permission_subcommand()

set_action_permission_subcommand::set_action_permission_subcommand ( CLI::App * actionRoot)
inline

Definition at line 984 of file main.cpp.

984 {
985 auto permissions = actionRoot->add_subcommand("permission", localized("set parmaters dealing with account permissions"));
986 permissions->add_option("account", accountStr, localized("The account to set/delete a permission authority for"))->required();
987 permissions->add_option("code", codeStr, localized("The account that owns the code for the action"))->required();
988 permissions->add_option("type", typeStr, localized("The type of the action"))->required();
989 permissions->add_option("requirement", requirementStr, localized("[delete] NULL, [set/update] The permission name require for executing the given action"))->required();
990
991 add_standard_transaction_options(permissions, "account@active");
992
993 permissions->callback([this] {
994 name account = name(accountStr);
995 name code = name(codeStr);
996 name type = name(typeStr);
997 bool is_delete = boost::iequals(requirementStr, "null");
998
999 if (is_delete) {
1000 send_actions({create_unlinkauth(account, code, type)});
1001 } else {
1002 name requirement = name(requirementStr);
1003 send_actions({create_linkauth(account, code, type, requirement)});
1004 }
1005 });
1006 }
std::string name
App * add_subcommand(std::string subcommand_name="", std::string subcommand_description="")
Add a subcommand. Inherits INHERITABLE and OptionDefaults, and help flag.
Definition CLI11.hpp:5538
Option * add_option(std::string option_name, callback_t option_callback, std::string option_description="", bool defaulted=false, std::function< std::string()> func={})
Definition CLI11.hpp:5099
CRTP * required(bool value=true)
Set the option as required.
Definition CLI11.hpp:3400
#define localized(str,...)
Definition localize.hpp:10
chain::action create_linkauth(const name &account, const name &code, const name &type, const name &requirement)
Definition main.cpp:782
chain::action create_unlinkauth(const name &account, const name &code, const name &type)
Definition main.cpp:787
void add_standard_transaction_options(CLI::App *cmd, string default_permission="")
Definition main.cpp:202
void send_actions(std::vector< chain::action > &&actions, packed_transaction::compression_type compression=packed_transaction::compression_type::none)
Definition main.cpp:616
Immutable except for fc::from_variant.
Definition name.hpp:43
Here is the call graph for this function:

Member Data Documentation

◆ accountStr

string set_action_permission_subcommand::accountStr

Definition at line 979 of file main.cpp.

◆ codeStr

string set_action_permission_subcommand::codeStr

Definition at line 980 of file main.cpp.

◆ requirementStr

string set_action_permission_subcommand::requirementStr

Definition at line 982 of file main.cpp.

◆ typeStr

string set_action_permission_subcommand::typeStr

Definition at line 981 of file main.cpp.


The documentation for this struct was generated from the following file: