Check that deletions are allowed

master
Bob Mottram 2019-08-04 20:34:15 +01:00
parent 7c7bb45c0d
commit 862cc3b68a
1 changed files with 7 additions and 6 deletions

View File

@ -310,11 +310,12 @@ class PubServer(BaseHTTPRequestHandler):
outboxUndoLike(self.server.baseDir,self.server.httpPrefix, \ outboxUndoLike(self.server.baseDir,self.server.httpPrefix, \
self.postToNickname,self.server.domain,self.server.port, \ self.postToNickname,self.server.domain,self.server.port, \
messageJson,self.server.debug) messageJson,self.server.debug)
if self.server.debug: if self.server.allowDeletion:
print('DEBUG: handle delete requests') if self.server.debug:
outboxDelete(self.server.baseDir,self.server.httpPrefix, \ print('DEBUG: handle delete requests')
self.postToNickname,self.server.domain, \ outboxDelete(self.server.baseDir,self.server.httpPrefix, \
messageJson,self.server.debug) self.postToNickname,self.server.domain, \
messageJson,self.server.debug)
if self.server.debug: if self.server.debug:
print('DEBUG: handle block requests') print('DEBUG: handle block requests')
outboxBlock(self.server.baseDir,self.server.httpPrefix, \ outboxBlock(self.server.baseDir,self.server.httpPrefix, \
@ -792,7 +793,7 @@ class PubServer(BaseHTTPRequestHandler):
return return
# delete a post from the web interface icon # delete a post from the web interface icon
if authorized and '?delete=' in self.path: if authorized and self.server.allowDeletion and '?delete=' in self.path:
deleteUrl=self.path.split('?delete=')[1] deleteUrl=self.path.split('?delete=')[1]
actor=self.path.split('?delete=')[0] actor=self.path.split('?delete=')[0]
if actor not in deleteUrl: if actor not in deleteUrl: