Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Update the authority example [docs] #9123

Merged
merged 7 commits into from
Jun 3, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions docs/02_cleos/03_command-reference/set/set-account.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set parameters dealing with account permissions
- `account` _TEXT_ - The account to set/delete a permission authority for
- `permission` _TEXT_ - The permission name to set/delete an authority for
- `authority` _TEXT_ - [delete] NULL, [create/update] public key, JSON string, or filename defining the authority
- `parent` _TEXT_ - [create] The permission name of this parents permission (Defaults to: "Active")
- `parent` _TEXT_ - [create] The permission name of this parents permission (Defaults to: "active")
## Options

`-h,--help` Print this help message and exit
Expand Down Expand Up @@ -38,17 +38,18 @@ To modify the permissions of an account, you must have the authority over the ac
The first example associates a new key to the active permissions of an account.

```sh
cleos set account permission test active '{"threshold" : 1, "keys" : [{"permission":{"key":"EOS8X7Mp7apQWtL6T2sfSZzBcQNUqZB7tARFEm9gA9Tn9nbMdsvBB","permission":"active"},"weight":1}], "accounts" : [{"permission":{"account":"acc2","permission":"active"},"weight":50}]}' owner
cleos set account permission test active '{"threshold":1,"keys":[{"key":"EOS8X7Mp7apQWtL6T2sfSZzBcQNUqZB7tARFEm9gA9Tn9nbMdsvBB","weight":1}],"accounts":[{"permission":{"actor":"acc2","permission":"active"},"weight":50}]}' owner
```
This second example modifies the same account permission, but removes the key set in the last example, and grants active authority of the @test account to another account.
This second example modifies the same account permission, but removes the key set in the last example, and grants active authority of the test account to another account.

```sh
cleos set account permission test active '{"threshold" : 1, "keys" : [], "accounts" : [{"permission":{"account":"sandwich","permission":"active"},"weight":1},{"permission":{"account":"acc1","permission":"active"},"weight":50}]}' owner
cleos set account permission test active '{"threshold":1,"keys":[],"accounts":[{"permission":{"actor":"acc1","permission":"active"},"weight":50},{"permission":{"actor":"sandwich","permission":"active"},"weight":1}]}' owner
```
The third example demonstrates how to setup permissions for multisig.

The third example demonstrates how to set up permissions for multisig.

```sh
cleos set account permission test active '{"threshold" : 100, "keys" : [{"permission":{"key":"EOS8X7Mp7apQWtL6T2sfSZzBcQNUqZB7tARFEm9gA9Tn9nbMdsvBB","permission":"active"},"weight":25}], "accounts" : [{"permission":{"account":"@sandwich","permission":"active"},"weight":75}]}' owner
cleos set account permission test active '{"threshold" : 100, "keys" : [{"key":"EOS8X7Mp7apQWtL6T2sfSZzBcQNUqZB7tARFEm9gA9Tn9nbMdsvBB","weight":25}], "accounts" : [{"permission":{"actor":"sandwich","permission":"active"},"weight":75}]}' owner
```
The JSON object used in this command is actually composed of two different types of objects

Expand Down