]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
moderators can delete others' notices using the api
authorhannes <h@nnesmannerhe.im>
Sat, 27 Feb 2016 01:03:24 +0000 (01:03 +0000)
committerhannes <h@nnesmannerhe.im>
Sat, 27 Feb 2016 01:03:24 +0000 (01:03 +0000)
actions/apistatusesdestroy.php

index 2d32124c42d48bcd984f0423848f1b374cb05322..f681ee8419c3f81906449a5acbb3bdf03f1d6389 100644 (file)
@@ -69,6 +69,7 @@ class ApiStatusesDestroyAction extends ApiAuthAction
         parent::prepare($args);
 
         $this->user = $this->auth_user;
+        $this->profile = $this->auth_user->getProfile();        
         $this->notice_id = (int)$this->trimmed('id');
 
         if (empty($notice_id)) {
@@ -122,7 +123,7 @@ class ApiStatusesDestroyAction extends ApiAuthAction
             return;
         }
 
-        if ($this->user->id == $this->notice->profile_id) {
+        if ($this->user->id == $this->notice->profile_id || $this->profile->hasRight(Right::DELETEOTHERSNOTICE)) {
             if (Event::handle('StartDeleteOwnNotice', array($this->user, $this->notice))) {
                 $this->notice->deleteAs($this->scoped);
                 Event::handle('EndDeleteOwnNotice', array($this->user, $this->notice));