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

feat: add permissions & voting power per roles per features #1443

Merged
merged 142 commits into from
Dec 20, 2024

Conversation

MikaelVallenet
Copy link
Member

@MikaelVallenet MikaelVallenet commented Dec 5, 2024

Add permissions & voting power per roles per resources

PR Description

Hello, This PR have for goal to allow people to assign resources to roles they create for their DAOs
I do this through a modal where user can check what resource they want for the role they are creating

image

Then when a user with the roles votes it looks like this for now (For now user can just assign 999 voting power to roles, but we have to think of a way to handle this as a user input when creating the roles)

It would be nice to have a way to display this in a more intuitive / explicite way, need to be discussed

image

What have be done

DoD checklist...
  • Modify the Interface IVotingModule to accept a feature when retrieving voting power
  • Create a new implementation of this interface called RolesVotingModule
  • New implementation works almost the same as the classic one but communicate with role manager to get informations about the power of the roles
  • The voting power of the roles is handle in the wrapper of role manager for dao
  • Add NewRoleJSON Wrapper method to expect a json array of {resource, power}
  • Change UI to make a modal IAM like that when creating a role you can hit some checkbox to give power on some features
  • Add a new template of DAO code generation using the roles voting group
  • Use this new template in roles based TORG
  • Now, a user with permissions on a feature could be able to "bypass" proposals (still need to create the proposal, but the user could execute right after that)
  • Add New Gno Test
  • Add Checkboxes to allow creator to choose what resources to assign to roles

What Next Priotities:

Add a user input to set the power of a role (numeric) - assign to me @MikaelVallenet

image

Change the Roles Settings Page in the creation form flow

image

I would like a table to see the roles with a details modal with all roles when we click on it

Dropdown to allow to assign user with roles created

Use a select input in RolesSettingsSection, plugged to the previously created roles

image

Add a Roles Page that display each roles settings based on UI of an IAM/excel table

image

Use the color choose to display the roles

image

Change the text input by a dropdown multi selector

What could be nice to have

Color Picker to choose the role color

Create a color picker and use it in MultisigMembers

image

Enhance Roles Review

Display resources linked to roles in a better way

MikaelVallenet and others added 30 commits October 10, 2024 16:52
Copy link
Collaborator

@WaDadidou WaDadidou left a comment

Choose a reason for hiding this comment

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

Partial

Comment on lines 127 to 134
<View style={{ flex: 1, flexDirection: "row" }}>
<TouchableOpacity onPress={() => onCheckboxChange(index)}>
<CheckboxDappStore isChecked={resource.value} />
</TouchableOpacity>
<SpacerRow size={1} />
<BrandText style={fontSemibold18}>{resource.name}</BrandText>
<SpacerColumn size={4} />
</View>
Copy link
Collaborator

@WaDadidou WaDadidou Dec 17, 2024

Choose a reason for hiding this comment

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

You can import Checkbox from "@/screens/Mini/components/Checkbox/Checkbox";
(Btw, yes, we must export that from Mini, it makes non sense)

Suggested change
<View style={{ flex: 1, flexDirection: "row" }}>
<TouchableOpacity onPress={() => onCheckboxChange(index)}>
<CheckboxDappStore isChecked={resource.value} />
</TouchableOpacity>
<SpacerRow size={1} />
<BrandText style={fontSemibold18}>{resource.name}</BrandText>
<SpacerColumn size={4} />
</View>
<>
<SpacerColumn size={.5} />
<Checkbox
isChecked={resource.value}
value={resource.name}
label={resource.name}
onPress={() => onCheckboxChange(index)}
/>
<SpacerColumn size={.5} />
</>

Copy link
Member Author

Choose a reason for hiding this comment

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

I think i tried the mini but it was smaller and looked weird but i will see

Copy link
Member Author

Choose a reason for hiding this comment

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

@clegirar
Copy link
Collaborator

clegirar commented Dec 17, 2024

Can we open an hackmd for next priorities ? I have some suggestions too (pure UI for the moment)
And better to be perfectly aligned 👍

@MikaelVallenet
Copy link
Member Author

Can we open an hackmd for next priorities ? I have some suggestions too (pure UI for the moment) And better to be perfectly aligned 👍

Yes sure i will open this ASAP

@MikaelVallenet MikaelVallenet marked this pull request as ready for review December 18, 2024 16:10
Comment on lines +51 to 55
// important to keep this order since voting module might depend on roles module
core.rolesModule = rolesModuleFactory(core)
if core.rolesModule == nil {
panic("roles module factory returned nil")
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should remove the role manager from the core interfaces and implem, is there a real need to have it there?

Copy link
Member Author

Choose a reason for hiding this comment

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

to inform ppl, we decided to do this improvement in a next PR

@n0izn0iz
Copy link
Collaborator

aussi, sur le fondement de l'article 49 alinéa 3 de la constitution, j'engage la responsabilité de mon organisation décentralisée sur l'application de la requête de fusionnement numéro 1443

@n0izn0iz n0izn0iz merged commit a475671 into main Dec 20, 2024
23 checks passed
@n0izn0iz n0izn0iz deleted the dev/mikaelvallenet/feat/add-permission-in-roles-based-dao branch December 20, 2024 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DOrg Deployer Everything related to the Organization Deployer enhancement New feature or request Gno UX/UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants