fix: lookup action roles from the params and simplify stuff #4169
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.
Description
This one was quite something to wrap one's head around 😅
Basically I've unified how we get roles from the action. We now display a difference between the user's assigned roles and historic roles (if they don't exist, then their current roles in the colony).
Additionally, we determine that an action is removing roles if all the values in the roles array are
false
, which is true in regards to how we call the contract.For example, if the user has the roles
[2, 5 ,6]
and we want to update their roles to[2, 6]
, we would call the contract with new roles and those override the old ones.Testing
I am sorry, this one's quite a doozy, but I'll try to make it as concise as possible.
leela
the Multi-SigOwner
role inGeneral
amy
thePayer
permission bundle inAndromeda
via Permissions and verify it shows up and you can redo itfry
thePayer
permissions inAndromeda
via Multi-sig. Make sure everything is correct and finalize the action so the roles get applied.amy
theAdmin
permission bundle inAndromeda
via a voting reputation motion. Verify it shows up as the admin bundle in the UI. No need to finalize the motionat all 👍fry
custom roles by removing theAdministration
role via permissions from the custom toggle form. NOTE: this is a bit funky with the titles, onmaster
we show this action asRemoving permissions
but motions showAdd custom permissions
🤷fry
's roles inAndromeda
via Multi-Sig.Whew alright we made it to the end of testing all of this via Permissions, so now let's just do the same for Multi-Sig roles 🫠
amy
thePayer
Multi-Sig permission bundle inAscendant
viaPermissions
fry
thePayer
Multi-Sig permissions inAscendant
via Multi-sig. Make sure everything is correct and finalize the action so the roles get applied.amy
custom permissions and toggle theArchitecture
role by hand inAscendant
via a voting reputation motion. Verify it shows up as the admin bundle in the UI. No need to finalize the motionat all 👍Administration
Multi-Sig role inAscendant
fromfry
via permissions and make sure it shows up correctly.fry
's Multi-Sig roles inAscendant
via a voting reputation motion and make sure everything shows up as expectedLast but not least, make sure that the
Redo action
popup in the activity feed shows up for actions which are not removing permissions. My dev env just crashed when doing this step 🫠Diffs
Changes 🏗
SetUserRoles
completed action view now contains some more comments on what's being done code-wiseResolves #4003