]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Notice.php
Merge remote-tracking branch 'upstream/master' into social-master
[quix0rs-gnu-social.git] / classes / Notice.php
index 0fe1296bc3f8624573941e4219b29b8d26a440f2..37310af8ef638190df12783aa65bccf52c93b5a9 100644 (file)
@@ -158,6 +158,14 @@ class Notice extends Managed_DataObject
         $this->_profile[$this->profile_id] = $profile;
     }
 
+    public function deleteAs(Profile $actor)
+    {
+        if ($this->getProfile()->sameAs($actor) || $actor->hasRight(Right::DELETEOTHERSNOTICE)) {
+            return $this->delete();
+        }
+        throw new AuthorizationException('You are not allowed to delete other user\'s notices');
+    }
+
     function delete($useWhere=false)
     {
         // For auditing purposes, save a record that the notice