joystream icon indicating copy to clipboard operation
joystream copied to clipboard

Proposal: Merge permission and version store

Open bedeho opened this issue 6 years ago • 1 comments

Background

The 2.0 proposal

https://github.com/Joystream/joystream/issues/175

Problem

Like the current content directory, the 2.0 proposal preserves the store vs permissions distinction. This distinction originates from the early implementations, and while the aspiration of reusability is honorable, it may not be the right abstraction to try to make reusable. All usage of the version store is likely to require something like the permissions module on top, and while the particular structure of this layer may differ from use case to use case, the separation is creating a lot of friction.

Solution

Just replace both modules with a single module which is called ContentDirectory, which does the following

  • Class and ClassPermission, only have one instance per class, and only one map
  • Entity and EntityPermission, only have one instance per entity, and only one map.
  • Drop ClassPermission::properties_locked_from_controller, and instead enrich PropertyType to include a locking flag for controllers.
  • Drop ClassPermission::properties_locked_from_maintainers, and instead enrich PropertyType to include a locking flag for maintainers.
  • Drop ClassPermission::referenced_entity_must_have_same_controller, and instead enrich PropertyType::Reference to include a same owner boolean flag.

A lot of runtime invariants are replaced with clean static checks, and it becomes easier to just think about one store, with an integrated ownership and permissions model.

bedeho avatar Mar 09 '20 14:03 bedeho

Closed by https://github.com/Joystream/joystream/pull/396

iorveth avatar Dec 02 '20 23:12 iorveth