[open-ils-commits] r11545 - trunk/Open-ILS/src/c-apps

svn at svn.open-ils.org svn at svn.open-ils.org
Sun Dec 14 16:30:48 EST 2008


Author: miker
Date: 2008-12-14 16:30:44 -0500 (Sun, 14 Dec 2008)
New Revision: 11545

Modified:
   trunk/Open-ILS/src/c-apps/oils_cstore.c
Log:
return true if no permissions are specified

Modified: trunk/Open-ILS/src/c-apps/oils_cstore.c
===================================================================
--- trunk/Open-ILS/src/c-apps/oils_cstore.c	2008-12-14 21:29:46 UTC (rev 11544)
+++ trunk/Open-ILS/src/c-apps/oils_cstore.c	2008-12-14 21:30:44 UTC (rev 11545)
@@ -826,7 +826,6 @@
     osrfStringArray* context_org_array = osrfNewStringArray(1);
 
     char* pkey_value = NULL;
-    int OK = 0;
     int err = 0;
     if (global_required && strcmp( "true", global_required )) {
         // check for perm at top of org tree
@@ -838,7 +837,7 @@
         if (!_tree_top) {
             jsonObjectFree(_tmp_params);
             jsonObjectFree(_list);
-            return -1;
+            return 0;
         }
 
         osrfStringArrayAdd( context_org_array, oilsFMGetString( _tree_top, "id" ) );
@@ -876,7 +875,7 @@
             if (!param) {
                 jsonObjectFree(_tmp_params);
                 jsonObjectFree(_list);
-                return -1;
+                return 0;
             }
 
             jsonObjectFree(_tmp_params);
@@ -919,7 +918,7 @@
                 if (!_fparam) {
                     jsonObjectFree(_tmp_params);
                     jsonObjectFree(_list);
-                    return -1;
+                    return 0;
                 }
     
                 jsonObjectFree(_tmp_params);
@@ -939,8 +938,11 @@
         jsonObjectFree(param);
     }
 
-    char* context_org;
-    char* perm;
+    char* context_org = NULL;
+    char* perm = NULL;
+    int OK = 0;
+
+    if (permission->size == 0) OK = 1;
     
     int i = 0;
     while ( (perm = osrfStringArrayGetString(permission, i++)) ) {
@@ -995,8 +997,7 @@
     if (pkey_value) free(pkey_value);
     osrfStringArrayFree(context_org_array);
 
-    if (!OK) return 0;
-    return 1;
+    return OK;
 }
 #endif
 



More information about the open-ils-commits mailing list