This repository has been archived by the owner on Apr 30, 2024. It is now read-only.
Enhancements to AccessController for Improved Usability #63
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces enhancements to the AccessController contract, focusing on improving ease of use and providing more detailed feedback during permission checks. The changes are divided into two main parts:
1. Modification of
checkPermission
BehaviorPreviously, the
checkPermission
function returned a boolean value indicating whether the permission check passed or failed. To provide more detailed feedback on failure, we've changed this function to revert with specific error instead. This approach allows for easier debugging and a clearer understanding of why a permission check failed.2. Introduction of
AccessControlled
Abstract ClassTo facilitate the integration of modules with the AccessController, we've introduced a new abstract class named
AccessControlled
. This class provides modifiers for permission checks that modules can use to easily integrate permission checks, streamlining the process and reducing boilerplate code.Testing and Code Coverage
To ensure the reliability and robustness of the new changes, comprehensive testing has been conducted, covering both positive and negative scenarios. The tests aim to validate the functionality of the modified
checkPermission
behavior and the integration capabilities of the AccessControlled abstract class.Highlights:
These enhancements aim to make the AccessController more user-friendly and informative, simplifying the integration process for modules and providing clearer feedback during permission checks. The comprehensive testing and full code coverage further underscore our commitment to quality and reliability.