-
Notifications
You must be signed in to change notification settings - Fork 117
Proposal: Merge permission and version store #380
Description
Background
The 2.0 proposal
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
ClassandClassPermission, only have one instance per class, and only one mapEntityandEntityPermission, only have one instance per entity, and only one map.- Drop
ClassPermission::properties_locked_from_controller, and instead enrichPropertyTypeto include a locking flag for controllers. - Drop
ClassPermission::properties_locked_from_maintainers, and instead enrichPropertyTypeto include a locking flag for maintainers. - Drop
ClassPermission::referenced_entity_must_have_same_controller, and instead enrichPropertyType::Referenceto 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.