changeset 388:1c13ba86a421

backend: allow admins to retract any item
author Goffi <goffi@goffi.org>
date Fri, 15 Feb 2019 15:56:30 +0100
parents 04e7dcc436ca
children 66128656f76c
files src/backend.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/backend.py	Tue Feb 12 21:10:00 2019 +0100
+++ b/src/backend.py	Fri Feb 15 15:56:30 2019 +0100
@@ -1096,7 +1096,10 @@
             and raise error.Forbidden if it is not the case
             """
             # TODO: the behaviour should be configurable (per node ?)
-            if any((requestor.userhostJID() != publisher.userhostJID() for publisher in publishers_map.itervalues())):
+            if (any((requestor.userhostJID() != publisher.userhostJID()
+                    for publisher in publishers_map.itervalues()))
+                and not self.isAdmin(requestor)
+               ):
                 raise error.Forbidden()
 
         if affiliation in ['owner', 'publisher']: