LP1783421 - Make Copy Alerts permission not global
authorJames Fournie <jfournie@vcc.ca>
Thu, 17 Jan 2019 21:23:12 +0000 (13:23 -0800)
committerJason Stephenson <jason@sigio.com>
Mon, 28 Jan 2019 20:14:51 +0000 (15:14 -0500)
For some reason copy alerts require global permissions.  Instead
update the IDL for asset.active_copy_alert and asset.copy_alert to
require {CREATE,VIEW,UPDATE,DELETE}_COPY_ALERT perms only as far as
they are scoped for the circ lib of the copy.

Signed-off-by: James Fournie <jfournie@vcc.ca>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Signed-off-by: John Amundson <jamundson@cwmars.org>
Signed-off-by: Jason Stephenson <jason@sigio.com>

Open-ILS/examples/fm_IDL.xml

index d541e5f..c66eaad 100644 (file)
@@ -7589,10 +7589,18 @@ SELECT  usr,
                </links>
         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
             <actions>
-                <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT" global_required="true"/>
-                <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT" global_required="true"/>
-                <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT" global_required="true"/>
-                <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT" global_required="true"/>
+                <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
+                    <context link="copy" field="circ_lib"/>
+                </create>
+                <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
+                    <context link="copy" field="circ_lib"/>
+                               </retrieve>
+                <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
+                    <context link="copy" field="circ_lib"/>
+                               </update>
+                <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
+                    <context link="copy" field="circ_lib"/>
+                               </delete>
             </actions>
         </permacrud>
        </class>
@@ -7617,10 +7625,18 @@ SELECT  usr,
                </links>
         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
             <actions>
-                <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT" global_required="true"/>
-                <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT" global_required="true"/>
-                <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT" global_required="true"/>
-                <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT" global_required="true"/>
+                <create permission="ADMIN_COPY_ALERT CREATE_COPY_ALERT">
+                    <context link="copy" field="circ_lib"/>
+                </create>
+                <retrieve permission="ADMIN_COPY_ALERT VIEW_COPY_ALERT">
+                    <context link="copy" field="circ_lib"/>
+                               </retrieve>
+                <update permission="ADMIN_COPY_ALERT UPDATE_COPY_ALERT">
+                    <context link="copy" field="circ_lib"/>
+                               </update>
+                <delete permission="ADMIN_COPY_ALERT DELETE_COPY_ALERT">
+                    <context link="copy" field="circ_lib"/>
+                               </delete>
             </actions>
         </permacrud>
        </class>