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

index 40b299f..ce54e6f 100644 (file)
@@ -51,30 +51,39 @@ class MTrackWeb_Roo extends Pman_Roo
         if (!$res) {
             return $res;
         }
+        
+        if (!$this->authUser && $this->authUser->company()->comptype == 'OWNER') {
+            return true;
+        }
+        // these checks only apply to non-company users.
+        
         // normally allowed, but we have more restrictions...
         switch($obj->tablename()) {
             case 'core_enum':
-                if (empty($req['etype']) {
+                if (empty($req['etype'])) {
                     return false;
                 }
+                if ($lvl != 'S') {
+                    return false;
+                }
+                
                 switch ($req['etype']) {
-                    
-                 if ($perm == 'S') {
-                        return true;
-                    }
-                    
-                    
-                    if (!$au) {
-                        return false;
-                    }
-                    
-                    if ($au->company()->comptype == 'OWNER') {
-                        return true;
-                    }
+                    case 'severity':
+                    case 'classification':
+                    case 'severity':
+                    case 'resolution':
+                    case 'priority':
+                    case 'ticketstate':                    
+                     
                     
                     // not a member of the company..
                     // not allowed in..
-                    return false;
+                    return true;
+                }
+                return false;
+            
+            default:
+                return false;
                 
             
             
@@ -82,7 +91,5 @@ class MTrackWeb_Roo extends Pman_Roo
         
         
         
-        return $res;
-        
     }
-}
\ No newline at end of file
+}