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

[docs]updating unlink permission to new how to template #10444

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
49 changes: 36 additions & 13 deletions docs/02_cleos/02_how-to-guides/how-to-unlink-permission.md
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

`Cleos` -> `cleos`

* 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
Copy link
Contributor

Choose a reason for hiding this comment

The 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
Copy link
Contributor

Choose a reason for hiding this comment

The 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.