MTrackWeb/Roo.php
authorAlan Knowles <alan@roojs.com>
Thu, 19 Mar 2015 02:47:55 +0000 (10:47 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 19 Mar 2015 02:47:55 +0000 (10:47 +0800)
MTrackWeb/Roo.php

index 6543da5..40b299f 100644 (file)
@@ -52,10 +52,29 @@ class MTrackWeb_Roo extends Pman_Roo
             return $res;
         }
         // normally allowed, but we have more restrictions...
-        switch($res->tablename()) {
+        switch($obj->tablename()) {
             case 'core_enum':
-                
-                
+                if (empty($req['etype']) {
+                    return false;
+                }
+                switch ($req['etype']) {
+                    
+                 if ($perm == 'S') {
+                        return true;
+                    }
+                    
+                    
+                    if (!$au) {
+                        return false;
+                    }
+                    
+                    if ($au->company()->comptype == 'OWNER') {
+                        return true;
+                    }
+                    
+                    // not a member of the company..
+                    // not allowed in..
+                    return false;