Skip to content

Commit

Permalink
[docs]: Remove CanMintUserAssetDefinitions (#460)
Browse files Browse the repository at this point in the history
Signed-off-by: 6r1d <[email protected]>
  • Loading branch information
6r1d committed Jan 8, 2024
1 parent 74cd732 commit 3cde883
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions src/reference/permissions.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ The following permission tokens are pre-configured in Iroha 2:
| [`CanRemoveKeyValueInUserAssets`](#canremovekeyvalueinuserassets) | Asset | Remove key value |
| [`CanTransferUserAssets`](#cantransferuserassets) | Asset | Transfer |
| [`CanTransferOnlyFixedNumberOfTimesPerPeriod`](#cantransferonlyfixednumberoftimesperperiod) | Asset | Transfer |
| [`CanMintUserAssetDefinitions`](#canmintuserassetdefinitions) | Asset Definition | Mint |
| [`CanBurnAssetWithDefinition`](#canburnassetwithdefinition) | Asset Definition | Burn |
| [`CanUnregisterAssetWithDefinition`](#canunregisterassetwithdefinition) | Asset Definition | Unregister |
| [`CanSetKeyValueInAssetDefinition`](#cansetkeyvalueinassetdefinition) | Asset Definition | Set key value |
Expand All @@ -29,33 +28,6 @@ won't be pre-configured permissions in the future.

:::

### `CanMintUserAssetDefinitions`

With `CanMintUserAssetDefinitions`, a user can register and mint assets
with the corresponding asset definition.

```rust
let mut genesis = RawGenesisBlock::new(
"alice".parse(),
"wonderland".parse(),
get_key_pair().public_key().clone(),
);
let rose_definition_id =
AssetDefinitionId::from_str("rose#wonderland")?;
let alice_id =
AccountId::from_str("alice@wonderland")?;

// Create a new `CanMintUserAssetDefinitions` permission token
// to mint rose assets (`rose_definition_id`)
let mint_rose_permission: PermissionToken =
CanMintUserAssetDefinitions::new(rose_definition_id).into();

// Grant Alice permission to mint rose assets
genesis.transactions[0]
.isi
.push(GrantBox::new(mint_rose_permission, alice_id).into());
```

### `CanBurnAssetWithDefinition`

With `CanBurnAssetWithDefinition` permission token, a user can burn and
Expand Down

0 comments on commit 3cde883

Please sign in to comment.