-
Notifications
You must be signed in to change notification settings - Fork 20
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
Implement access control for AccountStore members #3204
Open
silva-fj
wants to merge
31
commits into
dev
Choose a base branch
from
p-1240-implement-access-control-for-accountstore-members-in-the
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
d9c713d
using single storage unbounded instead of pallet::without_storage_info
silva-fj b7d0f00
adding integrity_test hook
silva-fj 2a7e934
adding new types to the pallet config
silva-fj caf080f
adding storage item for account member permissions
silva-fj 24e1fdf
adding new errors
silva-fj 82a36d6
storing default permission on create_account_store
silva-fj 1516f2e
adding comments
silva-fj eada06f
adding default permissions
silva-fj dc9a0f1
small refactoring
silva-fj 7d6241b
implementing ensure_permission
silva-fj eb1eaaa
updating mock
silva-fj 824e982
adding optional permissions to add_account, set defaults if None
silva-fj 2ef4b14
setting permissions on update_account_store_by_one
silva-fj 16bd79e
improving ensure_permission
silva-fj 0a16d34
updating mock
silva-fj efce874
refactoring add_account_call util
silva-fj d673c04
adding tests for permissions
silva-fj ae2444b
updating mock
silva-fj 3454462
adding Permission type to runtimes
silva-fj 5b36919
updating permissions mock and tests
silva-fj 7d0663c
adding set_permissions call
silva-fj 44bc0b1
adjusting ensure_permission
silva-fj 0984565
updating mock
silva-fj e04a8c0
updating permission filters in the runtimes
silva-fj 63784d0
adding tests for set_permissions call
silva-fj a893cd6
adding temporary fix for add_account
silva-fj 8cabe70
update storage on remove accounts
silva-fj ade319b
setting default permission when empty, only if the sender has default
silva-fj 0a29a43
Adjusting worker to allow managing AccountStore member permissions (#…
silva-fj 77b71a5
Merge branch 'dev' into p-1240-implement-access-control-for-accountst…
silva-fj 35786aa
Merge branch 'dev' into p-1240-implement-access-control-for-accountst…
BillyWooo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just wondering: is it better to return error here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returning
Err
means the member account does not have permissions, but that's not the case if it reaches this point.The permissions for the call are checked at the beginning of the method, the extra checks for
add_account
andset_permissions
are to make sure the caller cannot set permissions or add an account with more permissions than it (the caller) has. For all the other calls the permissions have already been checked.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I ask is:
ensure_permission
is only called byadd_account
andset_permissions
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ensure_permissions
is called ondispatch_as_signed
anddispatch_as_omni_account
(in this case the call to dispatch could beadd_account
orset_permissions
for example)