Extend onlyAuthorized to support extra functions in AccessManager#5014
Conversation
🦋 Changeset detectedLatest commit: 5f81c0f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| beforeEach('set required role', function () { | ||
| this.method = this.target.fnRestricted.getFragment(); | ||
| this.role = { id: 785913n }; | ||
| this.manager.$_setTargetFunctionRole(this.target, this.method.selector, this.role.id); |
There was a problem hiding this comment.
Should we set the function role for this.manager, this.method.selector ? It feels like we are testing restricted operation on the target when we should test the restricted operation on the manager.
|
We were loosing coverage for this section: // isTragetClosed apply to non-admin-restricted function
if (!adminRestricted && isTargetClosed(address(this))) {
return (false, 0);
}Turns out closing the manager is not allowed so it was unreachable. We decided to allow closing the manager so that the flag applies only to non-admin functions (i.e. functions added to the manager). This way the contract can close access to itself without getting it locked. Should be ready |
This PR adds the ability to extend the AccessManager and use the
onlyAuthorizedmodifer for those functions as well.PR Checklist
npx changeset add)