-
Notifications
You must be signed in to change notification settings - Fork 46
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
Improve the management of permissions #855
Labels
kind/new-feature
Propose the addition of a new feature that does not yet exist
x/subspaces
Issue on the x/subspaces module
Comments
RiccardoM
added
the
kind/new-feature
Propose the addition of a new feature that does not yet exist
label
May 5, 2022
This is a smart approach as it will allows to upgrade the permissions easily and require an on-chain upgrade each time the |
19 tasks
mergify bot
pushed a commit
that referenced
this issue
May 27, 2022
## Description This ADR contains the details of how the current permission system can be improved, based on #855. --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://docs.cosmos.network/v0.44/building-modules/intro.html) - [ ] included the necessary unit and integration [tests](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#testing) - [ ] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [x] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable)
19 tasks
mergify bot
pushed a commit
that referenced
this issue
Jun 8, 2022
## Description This PR improves the permissions systems as described on [ADR-014](https://github.com/desmos-labs/desmos/blob/master/docs/architecture/adr-014-improve-permissions.md). Closes: #855 --- ### Author Checklist *All items are required. Please add a note to the item if the item is not applicable and please add links to any relevant follow up issues.* I have... - [x] included the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [x] added `!` to the type prefix if API or client breaking change - [x] targeted the correct branch (see [PR Targeting](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#pr-targeting)) - [x] provided a link to the relevant issue or specification - [ ] followed the guidelines for [building modules](https://docs.cosmos.network/v0.44/building-modules/intro.html) - [x] included the necessary unit and integration [tests](https://github.com/desmos-labs/desmos/blob/master/CONTRIBUTING.md#testing) - [x] added a changelog entry to `CHANGELOG.md` - [ ] included comments for [documenting Go code](https://blog.golang.org/godoc) - [ ] updated the relevant documentation or specification - [x] reviewed "Files changed" and left comments if necessary - [x] confirmed all CI checks have passed ### Reviewers Checklist *All items are required. Please add a note if the item is not applicable and please add your handle next to the items reviewed if you only reviewed selected items.* I have... - [ ] confirmed the correct [type prefix](https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.json) in the PR title - [ ] confirmed `!` in the type prefix if API or client breaking change - [ ] confirmed all author checklist items have been addressed - [ ] reviewed state machine logic - [ ] reviewed API design and naming - [ ] reviewed documentation is accurate - [ ] reviewed tests and test coverage - [ ] manually tested (if applicable)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
kind/new-feature
Propose the addition of a new feature that does not yet exist
x/subspaces
Issue on the x/subspaces module
Feature description
Currently when handling permissions inside a subspace, we use the same method that is used inside Linux-based systems: permissions are managed using a single
uint
value which bytes are read individually. Although this system works properly and allows us to store a singleuint
value per user/group, it has some downsides:PermissionEverything
needs to be updated accordingly. An example of this can be seen here: two permissions where added (PermissionInteractWithContent
andPermissionEditOwnContent
) and thus thePermissionEverything
had to be updated as well;subspaces
module to include that permission as well.Instead of doing this, I think we can have a better way of managing permissions that allows each module to register their own permissions without having to always modify the
subspaces
module each time there is a new one.Implementation proposal
I suggest to create the following code
This way we could store a user permissions as follows:
Then, modules external to the
subspaces
one can simply register their custom permissions just like this:And use them as follows:
Please let me know what you think about this. I will write an ADR if you think this change should be implemented @bragaz @dadamu
The text was updated successfully, but these errors were encountered: