Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementing a weighted approval system #130

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

kondurake
Copy link

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

@splitbrain
Copy link
Member

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.

@kondurake
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants