diff --git a/docs/02_cleos/02_how-to-guides/how-to-unlink-permission.md b/docs/02_cleos/02_how-to-guides/how-to-unlink-permission.md index 0ca3b354261..4909808d9ff 100644 --- a/docs/02_cleos/02_how-to-guides/how-to-unlink-permission.md +++ b/docs/02_cleos/02_how-to-guides/how-to-unlink-permission.md @@ -1,20 +1,43 @@ -## Goal +## Overview +This guide provides instructions to unlink a linked permission to a smart contract action. -Unlink a linked permission level +The example uses `cleos` to unlink a custom permission _customp_ which is linked to the _hi_ action deployed to the _scontract_ account. -## Before you begin +## Before you Begin +Make sure you meet the following requirements: -* Install the currently supported version of `cleos` +* Install the currently supported version of `cleos.` +[[info | Note]] +| `Cleos` is bundled with the EOSIO software. [Installing EOSIO](../../00_install/index.md) will also install the `cleos` and `keosd` comand line tools. +* You have an EOSIO account and access to the account's `active` private key. +* You have created a custom permission and linked it. See [How to Link Permission](how-to-link-permission.md). -* Understand the following: - * What is an account - * What is permission level - * What is an action +## Command Reference +See the following reference guides for command line usage and related options: -## Steps +* [cleos set action permission](../03_command-reference/set/set-action-permission.md) command +## link Procedure -Remove a linked permission level from an action `transfer` of contract `hodlcontract` +The following step shows you how to link a permission: -```sh -cleos set action permission alice hodlcontract transfer NULL -``` \ No newline at end of file +1. Run the following command to unlink _alices_ account permission _customp_ with the _hi_ action deployed to the _scontract_ account: + +```shell +cleos set action permission alice scontract hi NULL -p alice@active +``` + +**Where** +* `alice` = The name of the account containing the permission to link. +* `scontract`= The name of the account which owns the smart contract. +* `hi` = The name of the action to link to a permission. +* `NULL` = Sets the permission to NULL. +* `-p alice@active` = The permission used to authorize linking the _customp_ permission. + +**Example Output** +```shell +executed transaction: 4eb4cf3aea232d46e0e949bc273c3f0575be5bdba7b61851ab51d927cf74a838 128 bytes 141 us +# eosio <= eosio::unlinkauth {"account":"alice","code":"scontract","type":"hi"} +``` + +## Summary +In conclusion, by following these instructions you are able to unlink a permission to a smart contract action.