[open-ils-commits] [GIT] Evergreen ILS branch master updated. df05ae28be786df311679e07f58cc2c50d976b11

Evergreen Git git at git.evergreen-ils.org
Thu Nov 8 13:21:25 EST 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  df05ae28be786df311679e07f58cc2c50d976b11 (commit)
       via  cfca470055f1f3f88d83f751caa13dfc63af0678 (commit)
      from  84c5f85907c823af8a8caf70e3f7dce3b005e86a (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit df05ae28be786df311679e07f58cc2c50d976b11
Author: Mike Rylander <mrylander at gmail.com>
Date:   Wed Oct 10 17:36:52 2012 -0400

    Make it possible to suppress IDL fields
    
    Some clients of external services, particularly pcrud and reporter-store,
    need to be able to access tables that contain columns we'd rather restrict.
    For instance, the passwd field on actor.usr.
    
    To effect this feature we provide a blacklist attribute for fields, called
    suppress_controller, which works in the same way as the class controller
    attribute but names controllers not allowed to use the field.  When the field
    is explicitly named in a query (fieldmapper select block or json_query) an
    error is thrown, and suppressed fields are ingored in general fieldmapper
    search/retreive requests.
    
    Signed-off-by: Mike Rylander <mrylander at gmail.com>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index 5b9725a..a7a765d 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -2805,7 +2805,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 			<field reporter:label="Is Group Lead Account" name="master_account" reporter:datatype="bool"/>
 			<field reporter:label="Internet Access Level" name="net_access_level" reporter:datatype="link"/>
 			<field reporter:label="Other Phone" name="other_phone"  reporter:datatype="text"/>
-			<field reporter:label="Password" name="passwd"  reporter:datatype="text"/>
+			<field reporter:label="Password" name="passwd" suppress_controller="open-ils.pcrud open-ils.reporter-store" reporter:datatype="text"/>
 			<field reporter:label="Photo URL" name="photo_url"  reporter:datatype="text"/>
 			<field reporter:label="Prefix/Title" name="prefix"  reporter:datatype="text"/>
 			<field reporter:label="Main (Profile) Permission Group" name="profile" reporter:datatype="link"/>
diff --git a/Open-ILS/examples/fm_IDL.xsd b/Open-ILS/examples/fm_IDL.xsd
index b2720a1..7ebbd51 100644
--- a/Open-ILS/examples/fm_IDL.xsd
+++ b/Open-ILS/examples/fm_IDL.xsd
@@ -51,6 +51,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
    <xs:element ref="idl:description" minOccurs="0" maxOccurs="1"/>
   </xs:sequence>
   <xs:attribute name="name"/>
+  <xs:attribute name="suppress_controller"/>
   <xs:attribute ref="oils_obj:array_position"/>
   <xs:attribute ref="oils_obj:required"/>
   <xs:attribute ref="oils_obj:validate"/>
diff --git a/Open-ILS/src/c-apps/oils_idl-core.c b/Open-ILS/src/c-apps/oils_idl-core.c
index 471435c..5d432ab 100644
--- a/Open-ILS/src/c-apps/oils_idl-core.c
+++ b/Open-ILS/src/c-apps/oils_idl-core.c
@@ -156,6 +156,13 @@ osrfHash* oilsIDLInit( const char* idl_filename ) {
 						snprintf( array_pos_buf, sizeof( array_pos_buf ), "%u", array_pos++ );
 						osrfHashSet( field_def_hash, strdup( array_pos_buf ), "array_position" );
 
+						// Tokenize suppress_controller attribute into an osrfStringArray
+						if( (prop_str = (char*)xmlGetProp(_f, BAD_CAST "suppress_controller")) ) {
+							osrfLogDebug(OSRF_LOG_MARK, "Controller suppression list is %s", prop_str );
+							osrfStringArray* controller = osrfStringArrayTokenize( prop_str, ' ' );
+							osrfHashSet( field_def_hash, controller, "suppress_controller");
+						}
+
 						if( (prop_str = (char*)xmlGetNsProp(_f, BAD_CAST "i18n", BAD_CAST PERSIST_NS)) ) {
 							osrfHashSet(
 								field_def_hash,
diff --git a/Open-ILS/src/c-apps/oils_sql.c b/Open-ILS/src/c-apps/oils_sql.c
index b262a70..a0ba678 100644
--- a/Open-ILS/src/c-apps/oils_sql.c
+++ b/Open-ILS/src/c-apps/oils_sql.c
@@ -4203,7 +4203,16 @@ char* SELECT (
 
 					// Look up the field in the IDL
 					const char* col_name = jsonObjectGetString( selfield );
-					osrfHash* field_def = osrfHashGet( class_field_set, col_name );
+					osrfHash* field_def;
+
+					if (!osrfStringArrayContains(
+							osrfHashGet(
+								osrfHashGet( class_field_set, col_name ),
+								"suppress_controller"),
+							modulename
+					))
+						field_def = osrfHashGet( class_field_set, col_name );
+
 					if( !field_def ) {
 						// No such field in current class
 						osrfLogError(
@@ -4282,7 +4291,16 @@ char* SELECT (
 							jsonObjectGetKeyConst( selfield, "column" ) );
 
 					// Get the field definition from the IDL
-					osrfHash* field_def = osrfHashGet( class_field_set, col_name );
+					osrfHash* field_def;
+					if (!osrfStringArrayContains(
+							osrfHashGet(
+								osrfHashGet( class_field_set, col_name ),
+								"suppress_controller"),
+							modulename
+					))
+						field_def = osrfHashGet( class_field_set, col_name );
+
+
 					if( !field_def ) {
 						// No such field in current class
 						osrfLogError(
@@ -5202,6 +5220,9 @@ static char* buildSELECT ( const jsonObject* search_hash, jsonObject* rest_of_qu
 			if( !field )
 				continue;
 
+			if (osrfStringArrayContains( osrfHashGet(field, "suppress_controller"), modulename ))
+				continue;
+
 			if( first ) {
 				first = 0;
 			} else {
@@ -6056,6 +6077,10 @@ int doUpdate( osrfMethodContext* ctx ) {
 		if( str_is_true( osrfHashGet( field_def, "virtual") ) )
 			continue;
 
+		if (osrfStringArrayContains( osrfHashGet(field_def, "suppress_controller"), modulename ))
+			continue;
+
+
 		const char* field_name = osrfHashIteratorKey( field_itr );
 		if( ! strcmp( field_name, pkey ) )
 			continue;
diff --git a/Open-ILS/web/reports/xul/source-browse.js b/Open-ILS/web/reports/xul/source-browse.js
index 4075dd1..0442e3a 100644
--- a/Open-ILS/web/reports/xul/source-browse.js
+++ b/Open-ILS/web/reports/xul/source-browse.js
@@ -36,6 +36,9 @@ function sourceTreeHandler (ev, dbl) {
 				var name = field.getAttributeNS(rptNS,'label');
 				if (!name) name = field.getAttribute('name');
 
+				var suppress = field.getAttribute('suppress_controller');
+				if (suppress && suppress.indexOf('open-ils.reporter-store') > -1) continue;
+
 				var idlclass = link_fields[i].getAttribute('class');
 				var map = link_fields[i].getAttribute('map');
 				var link = link_fields[i].getAttribute('field');
diff --git a/Open-ILS/web/reports/xul/source-setup.js b/Open-ILS/web/reports/xul/source-setup.js
index d3b919c..1e0d456 100644
--- a/Open-ILS/web/reports/xul/source-setup.js
+++ b/Open-ILS/web/reports/xul/source-setup.js
@@ -312,6 +312,9 @@ function populateDetailTree (tcNode, c, item) {
 		var type = fields[i].getAttributeNS(rptNS, 'datatype');
 		//if (!type) type = 'text';
 
+		var suppress = fields[i].getAttribute('suppress_controller');
+		if (suppress && suppress.indexOf('open-ils.reporter-store') > -1) continue;
+
 		var label = fields[i].getAttributeNS(rptNS, 'label');
 		var name = fields[i].getAttribute('name');
 		if (!label) label = name;

commit cfca470055f1f3f88d83f751caa13dfc63af0678
Author: Bill Erickson <berick at esilibrary.com>
Date:   Tue Nov 6 15:28:28 2012 -0500

    Move 'initial host' feature docs into 2.3 release notes
    
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/docs/RELEASE_NOTES_2_3.txt b/docs/RELEASE_NOTES_2_3.txt
index b8fc6be..2c0e9c5 100644
--- a/docs/RELEASE_NOTES_2_3.txt
+++ b/docs/RELEASE_NOTES_2_3.txt
@@ -513,3 +513,18 @@ Support is now available to create a credit card payment type in the SIP Fee
 Paid message. There is also now support for SIP clients to retrieve and
 display a detailed/itemized list of billings to the patron.
 
+Staff Client Initial Hostname
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+For fresh installs of the staff client a common issue is people remembering
+what hostname to specify. If you are building your own staff clients you can
+now fill this in automatically.
+
+You can specify this when configuring Evergreen with a new configure option:
+
+--with-initialhost=example.org
+
+It is also possible to specify when building the staff client itself using the
+INITIAL_HOST variable:
+
+make INITIAL_HOST=example.org build
diff --git a/docs/RELEASE_NOTES_NEXT/initial_host.txt b/docs/RELEASE_NOTES_NEXT/initial_host.txt
deleted file mode 100644
index 7699480..0000000
--- a/docs/RELEASE_NOTES_NEXT/initial_host.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-Staff Client Initial Hostname
------------------------------
-
-For fresh installs of the staff client a common issue is people remembering what hostname to specify. If you are building your own staff clients you can now fill this in automatically.
-
-You can specify this when configuring Evergreen with a new configure option:
-
---with-initialhost=example.org
-
-It is also possible to specify when building the staff client itself using the INITIAL_HOST variable:
-
-make INITIAL_HOST=example.org build

-----------------------------------------------------------------------

Summary of changes:
 Open-ILS/examples/fm_IDL.xml              |    2 +-
 Open-ILS/examples/fm_IDL.xsd              |    1 +
 Open-ILS/src/c-apps/oils_idl-core.c       |    7 +++++++
 Open-ILS/src/c-apps/oils_sql.c            |   29 +++++++++++++++++++++++++++--
 Open-ILS/web/reports/xul/source-browse.js |    3 +++
 Open-ILS/web/reports/xul/source-setup.js  |    3 +++
 docs/RELEASE_NOTES_2_3.txt                |   15 +++++++++++++++
 docs/RELEASE_NOTES_NEXT/initial_host.txt  |   12 ------------
 8 files changed, 57 insertions(+), 15 deletions(-)
 delete mode 100644 docs/RELEASE_NOTES_NEXT/initial_host.txt


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list