aragon / osx

Aragon OSx Protocol
GNU Affero General Public License v3.0
83 stars 43 forks source link

ACL improvements #19

Closed heueristik closed 2 years ago

heueristik commented 2 years ago

Situation

Currently, the ACL is intended to control access on the contract level. It is not intended to control user-level permissions.

https://github.com/aragon/zaragoza/blob/58710cc3677db5b04d2d65c53ca6bb6e147e10a7/packages/contracts/contracts/core/acl/ACL.sol#L34-L37

In this design concept, Components such as WhitelistVoting have to manage the user-level permissions themselves inside the Component contract. https://github.com/aragon/zaragoza/blob/58710cc3677db5b04d2d65c53ca6bb6e147e10a7/packages/contracts/contracts/votings/whitelist/WhitelistVoting.sol#L49

Remark: In WhitelistVoting, users can vote in either every voting or none at all. To allow for controlling access to single votings or have specific user groups, a more complicated permission management would be needed inside WhitelistVoting.

Problem Description

This design is problematic for several reasons: Permission-management for each component

Requirements

We need to be able to manage access for different actors: contracts, users, or groups (of both)

The access should be granular down to the level of specific objects managed by the smart contract via object identifiers.

Moreover, permissions dynamically depending on contract state would be nice to have.

A general requirement is that the developer-facing functions should be clear and self-explanatory in their usage and naming.

Possible Actions

  1. Add the functionality to the core ACL by modifying mapping (bytes32 => address) internal authPermissions; and associated functions to be more generic.
  2. Leave the ACL as is, but provide the user-level permission-management functionalities (user groups / roles, dynamic permissions) as a specialized DAO component using the ACLOracle
  3. Leave everything as is.
heueristik commented 2 years ago

In a call, Sam, Giorgi, and me opted for 2.

nivida commented 2 years ago

Thanks, Michael for writing this down.

As discussed on the call do @novaknole and I recommend keeping the ACL with the current degree of complexity it already has. Further permission management possibilities can be handled with the existing ACLOracle interface we provide. To improve the UX in case someone wants to have eg further permission levels do we definitely have to provide related packages in the upcoming marketplace to provide a no-code solution. Also, we should provide some abstract implementations of ACLOracle contracts over the Aragon SDK to improve the DX of package creators and/or third parties creating their own fully custom DAO based on the Aragon tech stack. I'm optimistic that we with this approach and good guides/documentation can prevent the problems you listed above while not adding more complexity to the core or limiting his flexibility.

nivida commented 2 years ago

as addition: We probably should overthink the naming of ACL and ACLOracle. I think for many third party engineers is it not clear what exactly ACL is and even less clear what ACLOracle means and what flexibility those two do provide.