askrobots / dbbasic-object-server
Public
Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.
dbbasic-package.json · 2.8 KB · 44 lines
| 1 | { |
| 2 | "id": "app-thread", |
| 3 | "name": "Thread", |
| 4 | "version": "0.2.0", |
| 5 | "description": "Generic comments: the thread_comments collection (attachable to a record in any collection via parent_collection/parent_id) plus window.dbbasicThread, the comment widget a collection mounts by declaring capabilities.comments. Replaces per-app comment tables. 0.1.1: a row a registered user writes could point at anybody's record, because the rules asked only that the new row be the writer's own. Every pointer a non-admin can write now declares relation.requires (thread_comments.reply_to_id read), so over the API a row points only at a record its writer may see, or, where it moves money, stock or state of what it points at, may update; a record they may not see is answered like a missing one (docs/permissions-model.md, 'Pointing at a record you may not act on'). 0.2.0: comment moderation works over the API. role:moderator, which could already read every comment and was named as the editor of status, may now update a comment, and that update can change nothing but status: parent_collection, parent_id, reply_to_id, body and author_name are editable by the comment's author and admins only, and a moderator cannot move the status of their own comment. A moderator (a person, or an AI agent holding a moderator's API key) publishes a pending comment (pending -> published), removes it, or flags or removes a published one; nobody else's access changes, and moderators get no delete. New attention count for moderators: other people's comments waiting in pending (thread_comments_to_moderate), opening a new page, /comments/pending (a seeded view: the pending comments the viewer may read; it lists, the decisions are a status PUT over the API). Depends on app-nav and app-views for them. On upgrade: reinstall the package, then give the role to whoever moderates (docs/permissions-model.md, 'Comment moderation').", |
| 6 | "compatibility": { |
| 7 | "dbbasic_object_server": ">=0.1.0" |
| 8 | }, |
| 9 | "dependencies": ["app-nav", "app-views"], |
| 10 | "objects": [ |
| 11 | { |
| 12 | "id": "site_thread", |
| 13 | "path": "objects/site/thread.py" |
| 14 | } |
| 15 | ], |
| 16 | "schemas": [ |
| 17 | { |
| 18 | "collection": "thread_comments", |
| 19 | "path": "schemas/thread_comments.json" |
| 20 | } |
| 21 | ], |
| 22 | "permissions": [ |
| 23 | { |
| 24 | "path": "permissions/rules.json" |
| 25 | } |
| 26 | ], |
| 27 | "seed": [ |
| 28 | {"collection": "views", "path": "seed/views.tsv"}, |
| 29 | {"collection": "site_routes", "path": "seed/site_routes.tsv"} |
| 30 | ], |
| 31 | "attention": [ |
| 32 | { |
| 33 | "id": "thread_comments_to_moderate", |
| 34 | "collection": "thread_comments", |
| 35 | "where": {"status": "pending", "owner_id": {"op": "ne", "value": "$user_id"}}, |
| 36 | "label": "Comments to moderate", |
| 37 | "path": "/comments/pending", |
| 38 | "group": "Publishing", |
| 39 | "severity": "normal" |
| 40 | } |
| 41 | ], |
| 42 | "migrations": [], |
| 43 | "nav_optional": true |
| 44 | } |