dokuwiki-plugin-publish
dokuwiki-plugin-publish copied to clipboard
Implementing a weighted approval system
At this moment, only AUTH_DELETE or AUTH_ADMIN can approve pages. My idea is to create a more flexible approval system by allowing the administrator to indicate which groups can approve pages, and what their weight is.
For example, if number_of_approved=10, thanks to this system a page can be approved by:
- One admin;
- Two moderators;
- Ten users;
- Or, one moderator and five users.
The value for the approving_weights option should be specified as query string (for example, the scenario above corresponds to admin=10&moderator=5&user=1). To avoid mistakes, the value is validated by a regular expression (conf/metadata.php:5), while invalid values are ignored (helper.php:264).
Theoretically, my commits should not affect old behavior (see helper.php:102 and helper.php:226). And of course, if the approving_weights option is not specified, everything will remain as before. However, I am new to Dokuwiki and I can make any mistakes. So please double check my commits and let me know if I missed something or you have any questions.
Testing environment
- PHP: 5.6.0
- Dokuwiki: 2018-04-22b "Greebo"
- Publish Plugin: 2019-01-10
I love the idea of this as it fits the spirit of a wiki more than the current approach.
However this plugin's source code is a mess already. It is in need of a proper refactoring and a whole bunch of tests before I would feel comfortable to add any new features.
Thank you! I'm glad you appreciate it. I plan to keep using the weighted approval system, and I'll let you know if there are any problems.
By the way, if you need extra hands, I can try to help you. So feel free to ping me.