Near-One / near-plugins

Implementation of common patterns used for NEAR smart contracts.
Creative Commons Zero v1.0 Universal
27 stars 12 forks source link

Add building blocks for Acl plugin #5

Closed mooori closed 1 year ago

mooori commented 2 years ago

Acl: Access control lists

This PR adds building blocks for an Acl plugin, inspired by OpenZeppelin Access Control.

There is a contract in near-plugins/tests/contracts/access_controllable which shows how to use the plugin. In integration test near-plugins/tests/access_controllable.rs the contract is compiled, deployed and transactions are sent to it (all via workspaces-rs).

# Command to execute the tests:
cargo test --test access_controllable

Note: If this doesn't compile, #6 should fix it.

Overview

Roadmap

This PR adds the basics for Acl and the contract and integration test mentioned above ensure that everything is wired together correctly. Upcoming PRs will add functionality to make this plugin feature equivalent to OpenZeppelin Access Control.

The target branch is acl (instead of master) since there will be more PRs on top of this.