Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the method for Java to create or modify permissions

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report