Status |
| ||||||
---|---|---|---|---|---|---|---|
Stakeholders | |||||||
Outcome | |||||||
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
- Customizable permissions check logic
- Customizable permission type
- Permission check logic is written in pure rust - which is a turing complete and convenient language while ISIs are not yet there.
- Faster than WASM
- Does not introduce additional complexity as WASM does.
...