Skip to content
This repository has been archived by the owner on Apr 30, 2024. It is now read-only.

Enhancements to AccessController for Improved Usability #63

Merged
merged 10 commits into from
Feb 3, 2024

Conversation

kingster-will
Copy link
Contributor

@kingster-will kingster-will commented Feb 2, 2024

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 Behavior

Previously, 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 Class

To 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:

  • Achieved 100% code coverage for all new code added.
  • Conducted extensive positive and negative testing to ensure the new features work as expected under various conditions.

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.

Copy link
Member

@LeoHChen LeoHChen left a comment

Choose a reason for hiding this comment

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

good and solid design

@kingster-will kingster-will merged commit 635ea4d into storyprotocol:main Feb 3, 2024
1 check passed
@kingster-will kingster-will deleted the access-enhance branch February 3, 2024 02:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants