feat: manage material visibility and shares

The management save/update body takes is_private, author_user_id and
share_user_ids (absent keeps each; a new material gets the caller as
author), and the managed material shows them. New routes PATCH
/materials/{id}/visibility, PUT /materials/{id}/shares and GET /users,
with the MCP tools bm_manage_set_material_visibility,
bm_manage_set_material_shares and bm_manage_list_users. The /bmadmin
form gets the private switch, the author picker and shared_with.
This commit is contained in:
Jakub Zych
2026-11-08 11:56:14 +01:00
parent 418f8240a4
commit 3346cb6ff6
13 changed files with 470 additions and 53 deletions

View File

@@ -4,6 +4,9 @@ columns:
searchable: true
type:
label: jz.bm::lang.materials.type
is_private:
label: jz.bm::lang.materials.is_private
type: switch
course:
label: jz.bm::lang.common.course
relation: course

View File

@@ -28,6 +28,18 @@ fields:
firstDay: 1
span: right
comment: jz.bm::lang.materials.published_at_comment
is_private:
label: jz.bm::lang.materials.is_private
type: switch
span: left
comment: jz.bm::lang.materials.is_private_comment
author:
label: jz.bm::lang.materials.author
type: relation
nameFrom: email
span: right
emptyOption: jz.bm::lang.common.none
comment: jz.bm::lang.materials.author_comment
source:
label: jz.bm::lang.common.source
type: text
@@ -47,6 +59,11 @@ fields:
label: jz.bm::lang.materials.tags
type: relation
nameFrom: name
shared_with:
label: jz.bm::lang.materials.shared_with
type: relation
nameFrom: email
comment: jz.bm::lang.materials.shared_with_comment
files:
label: jz.bm::lang.materials.files
type: fileupload