Skip to content

Proposal: Merge permission and version store #380

@bedeho

Description

@bedeho

Background

The 2.0 proposal

#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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions