]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Notice.php
Profile/Peopletag file splitting for autoload
[quix0rs-gnu-social.git] / classes / Notice.php
index 0d0933115e74615ac24f73ccfec7fe79592b2719..41c4544cf2fc69efc5ce84c43fbbea11729b2f5a 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