<field reporter:label="Settings" name="settings" oils_persist:virtual="true" reporter:datatype="link"/>
<field reporter:label="Addresses" name="addresses" oils_persist:virtual="true" reporter:datatype="link"/>
<field reporter:label="Checkins" name="checkins" oils_persist:virtual="true" reporter:datatype="link"/>
+ <field reporter:label="IP Range" name="ip_range" reporter:datatype="link"/>
<field reporter:label="Workstations" name="workstations" oils_persist:virtual="true" reporter:datatype="link"/>
<field reporter:label="Fund Allocation Percentages" name="fund_alloc_pcts" oils_persist:virtual="true" reporter:datatype="link"/>
<field reporter:label="Copy Location Orders" name="copy_location_orders" oils_persist:virtual="true" reporter:datatype="link"/>
<link field="rsrc_attrs" reltype="has_many" key="owner" map="" class="bra"/>
<link field="attr_vals" reltype="has_many" key="owner" map="" class="brav"/>
<link field="hours_of_operation" reltype="might_have" key="id" map="" class="aouhoo"/>
+ <link field="ip_range" reltype="has_many" key="id" map="" class="aoipr"/>
</links>
<permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
<actions>
</actions>
</permacrud>
</class>
+ <class id="aoipr" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_ip_range" oils_persist:tablename="actor.org_ip_range" reporter:label="Org Unit IP Range">
+ <fields oils_persist:primary="id" oils_persist:sequence="actor.org_ip_range_seq">
+ <field reporter:label="ID" name="id" reporter:datatype="id"/>
+ <field reporter:label="Organizational Unit" name="org_unit" reporter:datatype="org_unit"/>
+ <field reporter:label="IP Range" name="ip_range" reporter:datatype="text"/>
+ </fields>
+ <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
+ <actions>
+ <create permission="ADMIN_ORG_IP_RANGE"/>
+ <retrieve/>
+ <update permission="ADMIN_ORG_IP_RANGE"/>
+ <delete permission="ADMIN_ORG_IP_RANGE"/>
+ </actions>
+ </permacrud>
+ </class>
+
<class id="aouct" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="actor::org_unit_custom_tree" oils_persist:tablename="actor.org_unit_custom_tree" reporter:label="Org Unit Custom Tree">
<fields oils_persist:primary="id" oils_persist:sequence="actor.org_unit_custom_tree_id_seq">
<field reporter:label="ID" name="id" reporter:datatype="id"/>
__PACKAGE__->table( 'actor_org_unit' );
__PACKAGE__->columns( Primary => qw/id/);
__PACKAGE__->columns( Essential => qw/parent_ou ou_type mailing_address billing_address
- ill_address holds_address shortname name email phone opac_visible fiscal_calendar/);
+ ill_address holds_address shortname name email phone opac_visible fiscal_calendar ip_range/);
#-------------------------------------------------------------------------------
package actor::org_unit::hours_of_operation;
);
CREATE INDEX actor_org_unit_type_parent_idx ON actor.org_unit_type (parent);
+CREATE TABLE actor.org_ip_range (
+ id SERIAL PRIMARY KEY,
+ org_unit INT REFERENCES actor.org_unit (id) DEFERRABLE INITIALLY DEFERRED,
+ ip_range CIDR NOT NULL
+);
+
CREATE TABLE actor.org_unit (
id SERIAL PRIMARY KEY,
parent_ou INT REFERENCES actor.org_unit (id) DEFERRABLE INITIALLY DEFERRED,
holds_address INT,
mailing_address INT,
billing_address INT,
+ ip_range INT REFERENCES actor.org_ip_range (id) DEFERRABLE INITIALLY DEFERRED,
shortname TEXT NOT NULL UNIQUE,
name TEXT NOT NULL UNIQUE,
email TEXT,
CREATE INDEX actor_org_unit_billing_address_idx ON actor.org_unit (billing_address);
CREATE INDEX actor_org_unit_mailing_address_idx ON actor.org_unit (mailing_address);
CREATE INDEX actor_org_unit_holds_address_idx ON actor.org_unit (holds_address);
+CREATE INDEX actor_org_unit_ip_range_idx ON actor.org_unit (ip_range);
CREATE OR REPLACE FUNCTION actor.org_unit_parent_protect () RETURNS TRIGGER AS $$
DECLARE
--- /dev/null
+BEGIN;
+
+CREATE TABLE actor.org_ip_range (
+ id SERIAL PRIMARY KEY,
+ org_unit INT REFERENCES actor.org_unit (id) DEFERRABLE INITIALLY DEFERRED,
+ ip_range CIDR NOT NULL
+);
+
+ALTER TABLE actor.org_unit ADD COLUMN ip_range INT REFERENCES actor.org_ip_range (id) DEFERRABLE INITIALLY DEFERRED;
+CREATE INDEX actor_org_unit_ip_range_idx ON actor.org_unit (ip_range);
+
+COMMIT;