This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
[docs]updating unlink permission to new how to template #10444
Open
halsaphi
wants to merge
1
commit into
develop
Choose a base branch
from
docs/dev/how-to-template-update-unlink-permission
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
49 changes: 36 additions & 13 deletions
49
docs/02_cleos/02_how-to-guides/how-to-unlink-permission.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add blank line to next heading |
||
## 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 | ||
``` | ||
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ```shell -> ```console |
||
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. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`Cleos` -> `cleos`