Require logged-in in order to revert a wiki page
[citadel.git] / citadel / modules / wiki / serv_wiki.c
index f3b6ce1027a24dff1a25ec8b184b3542f9936373..81825c689c0d84d0207163d88d9229f6b4e5a7b1 100644 (file)
@@ -484,6 +484,14 @@ void wiki_rev(char *pagename, char *rev, char *operation)
                return;
        }
 
+       if (!strcasecmp(operation, "revert")) {
+               r = CtdlDoIHavePermissionToPostInThisRoom(temp, sizeof temp, NULL, POST_LOGGED_IN, 0);
+               if (r != 0) {
+                       cprintf("%d %s\n", r, temp);
+                       return;
+               }
+       }
+
        /* Begin by fetching the current version of the page.  We're going to patch
         * backwards through the diffs until we get the one we want.
         */