-
Notifications
You must be signed in to change notification settings - Fork 36
Description
Exploring different ideas on how we can implement "Projects": multiple documents with parent / child relationships and permission management.
Must have
User must be able to:
- create a project
- create new pages in a project
- create subpages of existing pages in a project
- move pages in a project to a different location in the project-tree
- share a project with other users
should have
- add pages to the project (or sub tree) that are not created in the scope of the project (i.e.: by a different user, or pre-existing pages). This probably means pages can have multiple parents
- share pages and subpages with users. Child pages should inherit permissions from its parent
- creating projects and moving documents should work offline, i.e. when not connected to matrix
Research re. Matrix permission management
Atm, we can set permissions for Rooms. Matrix has introduced Spaces, but is still figuring out authentication rules around this. Relevant MSCs:
-
MSC2962: Managing power levels via Spaces matrix-org/matrix-spec-proposals#2962
-
alternative: MSC3216: Synchronized access control for Spaces matrix-org/matrix-spec-proposals#3216
-
3083 is about having permission to join a room, based on membership of another room. Note that this is only about joining, so this does not "kick" users when the permission is lost. (see this part)
-
2962 is about managing power levels via space / room memberships. Power levels only manage the actions a user is allowed to take. It's unrelated to memberships (joining / reading rooms), so it does not cover our scenario
-
3216 similarly is about power levels (not membership)
Summary: this is not covered yet by Matrix, and part if this (cascading room permissions) was at least identified in 3083.
Brainstorming possible fixes:
- ensuring the permissions "one by one" when moving a room. Difficulties:
-- Would need a separate way to track whether a user that has joined, has joined "via the old parent room's permission", or has been invited directly to the child room. - Password protecting rooms, and posting the password in parent room (Matrix doesn't support password protected rooms yet)
- Matrix plugin / application service that manages these kind of permissions
- Storing "child docs" inside the parent doc. Disadvantages:
-- diverts from the "typecell model" (documents live as separate entities in a web"
-- permissions not manageable per child doc
-- loss of crdt based collaboration when moving child docs to a different parent
Other related challenges:
- if we store parent / child relationships in a document, how do we make sure they are in-sync with each other (avoid race conditions).
Maybe the most realistic option for now is to use a Space hierarchy and permission management from MSC3083. Later, we need to extend this (maybe with the help of Matrix folks) to make sure permissions are retracted when moving items to a different parent.
Challenges with this:
- make sure space hierarchy and document rels are in-sync. Ideally it would be possible to move documents around while offline, and sync up to matrix later
- at some point we should fix revocation, or warn the user when moving a document that user access is not revoked.
- How to make sure document power levels are in sync / copied?