Implementing a weighted approval system #130
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
At this moment, only
AUTH_DELETE
orAUTH_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:The value for the
approving_weights
option should be specified as query string (for example, the scenario above corresponds toadmin=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