Skip to content

Commit

Permalink
chore(permissions): define default permission set
Browse files Browse the repository at this point in the history
Signed-off-by: Marin Veršić <[email protected]>
  • Loading branch information
mversic committed Sep 13, 2024
1 parent cdf7dd7 commit 8bc8495
Show file tree
Hide file tree
Showing 6 changed files with 179 additions and 155 deletions.
10 changes: 5 additions & 5 deletions crates/iroha/tests/integration/transfer_domain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use iroha::{
use iroha_executor_data_model::permission::{
account::CanUnregisterAccount,
asset::CanUnregisterUserAsset,
asset_definition::CanUnregisterAssetDefinition,
domain::{CanRegisterAssetDefinitionInDomain, CanUnregisterDomain},
asset_definition::{CanRegisterAssetDefinition, CanUnregisterAssetDefinition},
domain::CanUnregisterDomain,
trigger::CanUnregisterUserTrigger,
};
use iroha_genesis::GenesisBlock;
Expand Down Expand Up @@ -59,7 +59,7 @@ fn domain_owner_domain_permissions() -> Result<()> {
test_client.submit_blocking(Unregister::asset_definition(coin_id))?;

// Granting a respective permission also allows "bob@kingdom" to do so
let permission = CanRegisterAssetDefinitionInDomain {
let permission = CanRegisterAssetDefinition {
domain: kingdom_id.clone(),
};
test_client.submit_blocking(Grant::account_permission(
Expand Down Expand Up @@ -158,7 +158,7 @@ fn domain_owner_asset_definition_permissions() -> Result<()> {
test_client.submit_blocking(Register::account(rabbit))?;

// Grant permission to register asset definitions to "bob@kingdom"
let permission = CanRegisterAssetDefinitionInDomain { domain: kingdom_id };
let permission = CanRegisterAssetDefinition { domain: kingdom_id };
test_client.submit_blocking(Grant::account_permission(permission, bob_id.clone()))?;

// register asset definitions by "bob@kingdom" so he is owner of it
Expand Down Expand Up @@ -222,7 +222,7 @@ fn domain_owner_asset_permissions() -> Result<()> {
test_client.submit_blocking(Register::account(bob))?;

// Grant permission to register asset definitions to "bob@kingdom"
let permission = CanRegisterAssetDefinitionInDomain { domain: kingdom_id };
let permission = CanRegisterAssetDefinition { domain: kingdom_id };
test_client.submit_blocking(Grant::account_permission(permission, bob_id.clone()))?;

// register asset definitions by "bob@kingdom" so he is owner of it
Expand Down
Loading

0 comments on commit 8bc8495

Please sign in to comment.