[OPEN-ILS-DEV] permissions question
Mike Rylander
mrylander at gmail.com
Thu Jun 11 14:10:23 EDT 2009
On Tue, Jun 9, 2009 at 12:38 PM, Catherine Buck
Morgan<Cmorgan at statelibrary.sc.gov> wrote:
> I have a core group of permissions set for the PATRON at the consortium
> level. Under PATRON are several patron types. However, we have one group of
> patrons that can only place holds on items owned by one particular system. I
> changed their permissions at the group level, adding MR_HOLDS and
> TITLE_HOLDS at the system level. However, when I look at one of these
> patrons in Edit User Permissions, I see those two permissions are still set
> for the consortium level instead of system level.
This sort of range restriction is done in the policy script instead of
the permission. You'd use something along the lines of:
// if the patron is in a "local-only" group...
if ( ( patronProfile.match("localHoldGroup1") ||
patronProfile.match("otherLocalHoldGroup") )
// ... and their home library is not within the same system as where
the item lives ...
&& !hasCommonAncestor(whereAmI, patron.home_ou.id, 1) ) {
// ... then disallow the hold
result.events.push('ITEM_NOT_HOLDABLE');
}
in circ_permit_hold.js. Because the target of the hold is a bib
record, and bib records don't have an owner (all shared everywhere),
there's no org unit to test the permissions against. We don't use the
copies on the bib as a surrogate because there is much more to
holdability of a copy for a particular patron than those range-type
tests.
In trunk/1.6 we have an interface for building all the hold and circ
rules, including these per-group range tests, for use with the in-db
circ/hold logic, but until then, the scripts are the way to go for
this.
Does that help?
(Also, do note the issues that Jason raises later in this thread about
doubling the perms for subgroups. We believe that the issues with
those are now simple aesthetic, but it's best to avoid the issue.)
--
Mike Rylander
| VP, Research and Design
| Equinox Software, Inc. / The Evergreen Experts
| phone: 1-877-OPEN-ILS (673-6457)
| email: miker at esilibrary.com
| web: http://www.esilibrary.com
More information about the Open-ils-dev
mailing list