scragg0x / realms-wiki

Git based wiki inspired by Gollum
http://realms.io
GNU General Public License v2.0
831 stars 90 forks source link

Prevent users/anons from deleting pages (Or have an administrative group) #134

Open antonizoon opened 8 years ago

antonizoon commented 8 years ago

In the current system, normal and even just anonymous users can delete pages. It is relatively easy to fix a revision or delete spam pages, but it is not so easy to restore deleted pages, without picking in the git repo.

While locking pages helps, that restricts everyone from editing.

Thus, here's some proposed solutions: have an option to restrict certain users from deleting pages. Here are some scenarios:

  1. Anonymous users can edit, but cannot delete pages
  2. Anonymous and normal users can edit, but cannot delete pages.

This might also need the implementation of an Administrator group. I think the first account, UID=0 or 1, would suffice as the first admin (the way Gogs does it). Thus, maybe only the administrator would have the ability to delete pages.