cosmocode / dokuwiki-plugin-struct

A new structured data plugin
https://www.dokuwiki.org/plugin:struct
GNU General Public License v2.0
40 stars 40 forks source link

Feature requests (1) hide row creation by "rowcreation: 0" (2) hide deletion by "deletion:0" in global schema editing #649

Open paul-jh opened 1 year ago

paul-jh commented 1 year ago

For global schema edits it would be nice to have an option "rowcreation" that enables [default] or disables the row creation editor below the editor. The users then are able to edit data that was prepared by admins but not to alter (enhance) the database by new data sets.

For example this:

---- struct global ----
schema: socialmedia
cols: name, link
rowcreation: 0
----

should prevent the user from adding any new data set to the schema by hiding the form for row creation.

I tried to implement this on my own. In [1] there is a diff(1) logfile showing the differences btw. the original struct files and those modified by me. It works, but i am quite sure, i missed some crucial points (...).

[1] struct.diff.log

p.s.: As far as i can see, there is no option to prevent the user from deletion in global schema editing. I would also love to have a switch for this (i.e. hiding the trash-icons from the user), e.g. by a syntax like this ("deletion:0"):

---- struct global ----
schema: socialmedia
cols: name, link
deletion: 0
----
splitbrain commented 10 months ago

For implementing this the current "allowed editors" configuration of schema would need to be extended into a more complex setting. Allowing to differentiate between different write access (edit, create, delete) and possibly different schema uses (global, serial, page).