Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Pausable use Acl for authorization #47

Merged
merged 3 commits into from
Dec 9, 2022

Conversation

mooori
Copy link
Contributor

@mooori mooori commented Dec 7, 2022

Previously the Pausable plugin required a contract to be Ownable to manage authorization of (un)pausing features and to define exemptions via except. This PR makes Pausable use AccessControllable instead of Ownable.

Overview

  • Developers specify which Acl role(s) can pause and unpause features.
  • When using except with #[pause] or #[if_paused], developers can specify Acl role(s) which are exempted.

Examples

Files in examples/pausable-examples/ have not been updated, for now. I'd propose to remove the contracts there and instead add a test contract in /near-plugins/tests/contracts/pausable, see #48.

I suggest we first decide if this is a reasonable approach before updating examples.

@mooori mooori marked this pull request as ready for review December 7, 2022 16:03
Copy link

@birchmd birchmd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

near-plugins-derive/src/pausable.rs Show resolved Hide resolved
@mooori
Copy link
Contributor Author

mooori commented Dec 9, 2022

As discussed offline, merging now without modifying examples/pausable-examples. In a follow up PR I'll deduplicate and update examples and tests as described in #48.

@mooori mooori merged commit ab68372 into Near-One:master Dec 9, 2022
@mooori mooori deleted the pausable-acl branch December 9, 2022 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants