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

Standardize accessControl #150

Open
leoloco opened this issue Mar 13, 2024 · 0 comments
Open

Standardize accessControl #150

leoloco opened this issue Mar 13, 2024 · 0 comments

Comments

@leoloco
Copy link
Contributor

leoloco commented Mar 13, 2024

Context

The spirit of having a separate <library name>-internals.ts is to give developers full control of the logic they want to implement.
For example, in the accessControl standard, the grantRole function is implemented and exported by accesControl.ts and assumes that only the owner of the contract can grant a new role. This is a bad practice as this assumes the logic that developers wish to implement. If some developer wants to implement a different logic, for example, if some application require that the accessControl be managed by an external contract, it would need to reimplement the grantRole method with a different logic. This is error prone and goes against the idea of defining a standard.
Thus, I suggest to backport the grantRole method to the accessControl-internals.ts and that this function doesn't assume any logic behind the fact of creating a new role. This internal function will then be wrapped into the implementation contract, with the logic required by the application.

@leoloco leoloco changed the title Remove logic from accessControl Standardize accessControl Mar 13, 2024
@gregLibert gregLibert linked a pull request Mar 26, 2024 that will close this issue
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 a pull request may close this issue.

1 participant