Skip to content

Make Pausable use Acl for authorization#47

Merged
mooori merged 3 commits into
near:masterfrom
mooori:pausable-acl
Dec 9, 2022
Merged

Make Pausable use Acl for authorization#47
mooori merged 3 commits into
near:masterfrom
mooori:pausable-acl

Conversation

@mooori
Copy link
Copy Markdown
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.

Comment thread near-plugins-derive/src/access_control_role.rs
@mooori mooori marked this pull request as ready for review December 7, 2022 16:03
Copy link
Copy Markdown

@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

Comment thread near-plugins-derive/src/access_control_role.rs
Comment thread near-plugins-derive/src/pausable.rs
@mooori
Copy link
Copy Markdown
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:master Dec 9, 2022
@mooori mooori deleted the pausable-acl branch December 9, 2022 10:07
This was referenced Mar 27, 2026
This was referenced Apr 7, 2026
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