[open-ils-commits] r16880 - trunk/Open-ILS/src/c-apps (scottmk)
svn at svn.open-ils.org
svn at svn.open-ils.org
Thu Jul 8 10:56:39 EDT 2010
Author: scottmk
Date: 2010-07-08 10:56:37 -0400 (Thu, 08 Jul 2010)
New Revision: 16880
Modified:
trunk/Open-ILS/src/c-apps/oils_sql.c
Log:
Streamline pcrud a bit.
If there is a permacrud entry for the relevant action, but the list of
permissions is empty, we grant access.
The change: grant access as soon as the permission list can be known
to be empty, instead of doing a lot of irrelevant stuff first
(including extra database fetches in some cases).
M Open-ILS/src/c-apps/oils_sql.c
Modified: trunk/Open-ILS/src/c-apps/oils_sql.c
===================================================================
--- trunk/Open-ILS/src/c-apps/oils_sql.c 2010-07-08 14:31:46 UTC (rev 16879)
+++ trunk/Open-ILS/src/c-apps/oils_sql.c 2010-07-08 14:56:37 UTC (rev 16880)
@@ -1379,6 +1379,10 @@
// Get a list of permissions from the permacrud entry.
osrfStringArray* permission = osrfHashGet( pcrud, "permission" );
+ if( permission->size == 0 ) {
+ osrfLogDebug( OSRF_LOG_MARK, "No permissions required for this action, passing through" );
+ return 1;
+ }
// Build a list of org units that own the row. This is fairly convoluted because there
// are several different ways that an org unit may own the row, as defined by the
@@ -1677,11 +1681,6 @@
const char* perm = NULL;
int OK = 0;
- if( permission->size == 0 ) {
- osrfLogDebug( OSRF_LOG_MARK, "No permission specified for this action, passing through" );
- OK = 1;
- }
-
// For every combination of permission and context org unit: call a stored procedure
// to determine if the user has this permission in the context of this org unit.
// If the answer is yes at any point, then we're done, and the user has permission.
More information about the open-ils-commits
mailing list