DataObjects/Core_person_settings.php
authorEdward <edward@roojs.com>
Tue, 2 Apr 2019 03:57:31 +0000 (11:57 +0800)
committerEdward <edward@roojs.com>
Tue, 2 Apr 2019 03:57:31 +0000 (11:57 +0800)
DataObjects/Core_person_settings.php

index 1e016ec..1005ea5 100644 (file)
@@ -18,6 +18,15 @@ class Pman_Core_DataObjects_Core_person_settings extends DB_DataObject
     /* the code above is auto generated do not remove the tag below */
     ###END_AUTOCODE
     
-    
+    function beforeInsert($q, $roo)
+    {
+        if(
+                !$roo->authUser ||
+                (!empty($this->person_id) && $this->person_id != $roo->authUser->id)
+        ) {
+            $roo->jerr('Access Dennied');
+        }
+        
+    }
     
  }