Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

What is the method for Java to create or modify permissions

Shulou Source: shulou.com Published: 2022-06-01 02:52:15 10月02日 Update

This article mainly introduces "what is the method of creating or modifying permissions in Java". In daily operation, I believe that many people have doubts about the method of creating or modifying permissions in Java. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the doubts of "what is the method of creating or modifying permissions in Java?" Next, please follow the editor to study!

Create or modify permissions

Command format: $cleos set account permission ${permission} ${account} ${permission_json} ${account_authority}

To modify the permissions of an account, you must have the permissions of the account and the permissions you are modifying. The set account permissions command may change, so the class it is associated with does not have a complete record.

$cleos set account permission test active'{"threshold": 1, "keys": [{"permission": {"key": "EOS8X7Mp7apQWtL6T2sfSZzBcQNUqZB7tARFEm9gA9Tn9nbMdsvBB", "permission": "active"}, "weight": 1}], "accounts": [{"permission": {"actor": "acc2", "permission": "active"}, "weight": 50}]} 'owner

The second example modifies the same account permissions, but deletes the key set from the previous example and grants the active permissions of the @ test account to another account.

$cleos set account permission test active'{"threshold": 1, "keys": [], "accounts": [{"permission": {"actor": "sandwich", "permission": "active"}, "weight": 1}, {"permission": {"actor": "acc1", "permission": "active"}, "weight": 50}]} 'owner

The third example shows how to set permissions for multisig

Cleos set account permission test active'{"threshold": 100, "keys": [{"permission": {"key": "EOS8X7Mp7apQWtL6T2sfSZzBcQNUqZB7tARFEm9gA9Tn9nbMdsvBB", "permission": "active"}, "weight": 25}], "accounts": [{"permission": {"actor": "@ sandwich", "permission": "active"}, "weight": 75}]} 'owner

The JSON object used in this command actually consists of two different types of objects that make up the permission JSON object.

{"threshold": 100,100 / * An integer that defines cumulative signature weight required for authorization*/ "keys": [], / * An array made up of individual permissions defined with an EOS PUBLIC KEY*/ "accounts": [] / * An array made up of individual permissions defined with an EOS ACCOUNT*/}

... It includes one or more permission objects

/ * Set Permission with Key*/ {"permission": {"key": "EOS8X7Mp7apQWtL6T2sfSZzBcQNUqZB7tARFEm9gA9Tn9nbMdsvBB", "permission": "active"}, weight: 25 / * Set the weight of a signature from this permission*/} / * Set Permission with Account*/ {"permission": {"actor": "sandwich", "permission": "active"} Weight: 75 / * Set the weight of a signature from this permission*/} so far The study on "what is the method of creating or modifying permissions in Java" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Tags: Permissions accounts methods objects learning commands examples more help different practical the same and then three including multiple actual actually keys articles Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Xiaomi Shulou Tech Info Docker OPPO Reno