Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Status

Status
titleAccepted

IN PROGRESS

Stakeholders
Outcome

Jira
serverHyperledger JIRA
serverId6326cb0b-65b2-38fd-a82c-67a89277103b
keyIR-934

Due date
Owner

...


trait PermissionChecker<Permission> {
    pub fn check_permissions(instruction: ISI, authority: Id) -> Result<(), String>
}

Register<Permission, Account>: ISI #[derive(Encode, Decode, Serialize, Deserialize)] struct Account<Permission> { permissions: Vec<Permission>,
account_data: // .. other fields } struct Iroha<Permission, PC: PermissionChecker<Permission>> { pub checker: PC, // .. other fields }

Iroha<Iroha1Permission, Iroha1PermissionChecker>

enum Iroha1Permission {

}

Pros

  1. Customizable permissions check logic
  2. Customizable permission type
  3. Permission check logic is written in pure rust - which is a turing complete language and convinient convenient language while ISI ISIs are not yet there.
  4. Faster than WASM
  5. Does not introduce additional complexity as WASM does.

...