Koha-clms/C4
Galen Charlton 70d33a82bb granular permissions - C4::Auth
Enhanced the permission-checking functions in C4::Auth
(e.g., get_template_and_user, checkauth, check_api_auth, etc.).

If the CheckSpecificUserPermissions syspref is OFF, the behavior
of those APIs is unchanged.

If CheckSpecificUserPermissions is ON, then the value of each
key in the flagsrequired hash is considered during
the permissions check:

  1. if the value is 1, the staff user must have
     all privileges for the userflags flag (or module)
     referred to by the hash key, e.g.,

     { flaqsrequired => { tools => 1 } }

     In terms of the database, this means that the
     corresponding bit must be set in borrowers.flags.

  2. If the value is '*', the staff user must
     have at least one of the permissions for the
     userflag/module, but it doesn't matter which one.

     In terms of the database, this means ether that the
     corresponding bit must be set in borrowers.flags or
     that there at least is one row in user_permissions
     for the staff user and bit/module combination.

  3. If the value is any other string, it must be
     a permissions code defined in the permissions table.
     The staff user must have that specific permission
     or have access to all functions of the module

     In terms of the database, this means ether that the
     corresponding bit must be set in borrowers.flags or
     that there is a matching row in user_permissions
     for the staff user, bit/module, subpermission
     code combination.

In addition, get_template_and_user is modified so that the
CAN_user_XXX variables that it sets also includes the
subpermissions available (CAN_user_XXX_YYY, e.g.,
CAN_user_tools_import_patrons).  The template variables
for the specific permissions are set regardless of whether
CheckSpecificUserPermissions is ON or OFF so that the templates
don't have to test for that syspref explicitly.

In addition, the meaning of CAN_user_XXX has changed slightly -
CAN_user_tools, for example, is set to 1 in the template if the
user has access to *any* of the tools functions.  This was done
to simply the logic for deciding whether to display a menu
item in the staff interface are not.  This does mean that
when specific subpermissions are added to (say) the circulate
module, each use of CAN_user_circulate will need to be examined
to see if the intent is to allow the user to get at a circ
menu or page or if the user really should be required to have
all circulate functions.

Signed-off-by: Joshua Ferraro <jmf@liblime.com>
2008-04-10 15:53:13 -05:00
..
AuthoritiesMarc added C4/AuthoritesMarc/*.pm missed in previous patch 2008-01-04 19:08:30 -06:00
Barcodes PrinterConfig.pm - BEGIN block VERSION and vars related to export. 2008-01-07 20:02:21 -06:00
ClassSortRoutine ignore "/" when sorting Dewey call numbers 2007-10-23 18:24:29 -05:00
Heading authority headings search: remove CCL metacharacters 2008-02-08 06:01:43 -06:00
OAI OAI-PMH second try 2008-02-27 09:02:20 -06:00
SIP Changing CanBookBeRenewed to pass back the reason a renewal cannot proceed 2008-01-08 16:13:20 -06:00
Search FRBR: added OPAC search result grouping option 2008-02-11 16:35:17 -06:00
VirtualShelves fixing display of itemtypes and itemtype icons in virtual shelves 2008-03-17 20:12:38 -05:00
tests Patch from Galen Charlton, removing $Id$ $Log$ and $Revision$ from files 2007-10-18 20:22:01 -05:00
Accounts.pm bug 2006: do not crash when paying a lost item fine 2008-04-10 15:52:55 -05:00
Acquisition.pm bug 1953: removing potential SQL injection in C4::Acquisition::GetParcels 2008-04-10 03:00:40 -05:00
Amazon.pm adding famfamfam iconset, improving isbn for amazon content, etc. 2008-04-07 21:20:22 -05:00
Auth.pm granular permissions - C4::Auth 2008-04-10 15:53:13 -05:00
Auth_with_ldap.pm Perldoc fixes - Auth_with_ldap.pm and Log.pm 2007-12-13 19:00:35 -06:00
AuthoritiesMarc.pm bug 1890: fixing calls to C4::Search::SimpleSearch 2008-04-01 06:44:23 -05:00
BackgroundJob.pm C4 - BEGIN blocks and 1; __END__ for modules 2008-01-07 20:02:18 -06:00
Biblio.pm avoid croak on latest CVS version of MARC::Record 2008-04-01 06:44:07 -05:00
Bookfund.pm bug-1494, fixed bookfund modify code 2007-11-01 17:27:55 -05:00
Bookseller.pm acqui/addorder.pl - use reliable GetBookSellerFromId instead of relying on name search. 2008-03-08 11:19:27 -06:00
Boolean.pm Boolean.pm - BEGIN block VERSION and vars related to export. 2008-01-07 20:02:24 -06:00
Branch.pm Removing replace statement from C4::Branch as per bug 1546 2008-01-08 19:23:41 -06:00
Breeding.pm IMPORTANT - refactor MARC character set handling 2008-02-03 07:23:56 -06:00
Calendar.pm removed warns 2008-03-15 08:36:40 -05:00
Charset.pm work around issue in MARC::Charset 2008-04-01 06:46:04 -05:00
Circulation.pm use HomeOrHoldingBranch to determine if a return is valid or not 2008-04-10 02:52:49 -05:00
ClassSortRoutine.pm call number work part 2 -- added framework for call number filing routines 2007-10-21 22:11:37 -05:00
ClassSource.pm call number work part 3 -- now using new routines to generate call number sort keys 2007-10-21 22:11:40 -05:00
Context.pm Add backtrace printing option through SetEnv KOHA_BACKTRACES 1 2008-04-03 14:44:31 -05:00
Date.pm removing all useless %env / $env 2007-04-18 17:00:14 +00:00
Dates.pm Dates.pm - trivial perldoc corrections 2008-04-08 17:00:07 -05:00
Debug.pm C4::Debug - should resolve conflict w/ CGI upload. Debug no longer uses CGI. 2008-03-16 08:32:20 -05:00
Heading.pm bug 1890: fixing calls to C4::Search::SimpleSearch 2008-04-01 06:44:23 -05:00
ImportBatch.pm Partial commit to add Create-Label-Batch-from-Import-Batch 2008-03-17 21:32:30 -05:00
Input.pm Input.pm - perldoc correction 2007-12-27 17:21:07 -06:00
Items.pm add items.enumchron to _koha_new_item. 2008-04-10 02:59:23 -05:00
Koha.pm More cleanup of location & ccode authval handling. 2008-04-07 15:59:49 -05:00
Labels.pm More work on label printing tool 2008-04-04 13:44:44 -05:00
Languages.pm adding famfamfam iconset, improving isbn for amazon content, etc. 2008-04-07 21:20:22 -05:00
Letters.pm refactor C4::Log::logaction 2008-03-19 06:34:10 -05:00
Log.pm refactor C4::Log::logaction 2008-03-19 06:34:10 -05:00
Maintainance.pm rel_3_0 moved to HEAD (introducing new files) 2007-03-09 15:34:17 +00:00
Matcher.pm Matcher.pm - BEGIN block VERSION and vars related to export. 2008-01-07 20:02:33 -06:00
Members.pm use bind variables in GetBorrowersWhoHaveNotBorrowedSince query 2008-03-19 11:08:56 -05:00
NewsChannels.pm NewsChannels.pm - BEGIN block VERSION and vars related to export. 2008-01-07 20:02:36 -06:00
Output.pm Removing extra warn 2008-02-03 07:23:37 -06:00
Overdues.pm Fix calls to CalcFine, and make fines obey CircControl syspref (get homebranch withssue data). 2008-04-08 08:37:01 -05:00
Print.pm Print.pm - BEGIN block VERSION and vars related to export. 2008-01-07 20:02:39 -06:00
Record.pm fixed MODS biblio export on a "standard" install 2008-04-01 06:46:08 -05:00
Reports.pm bug 2004: changes to guided reports on items 2008-04-08 17:00:12 -05:00
Reserves.pm Add print slip to hold confirmation dialog. 2008-03-25 07:20:25 -05:00
Review.pm Fix for bug 1624 2008-01-09 14:49:48 -06:00
SMS.pm SMS - widespread cleanup and moving code away from Cyprus/Turkey-specific implementation. Much more needed. 2008-02-06 23:19:30 -06:00
Scheduler.pm Scheduler.pm - BEGIN block VERSION and vars related to export. 2008-01-07 20:02:45 -06:00
Search.pm Fixing bug 2005: ISBN Search 2008-04-09 05:46:03 -05:00
Serials.pm Reintroducing history dates for serial-issue (see previous commit for staff // feature) 2008-04-10 02:52:54 -05:00
Stats.pm Work in progress, working on the til reconciliation report 2008-01-07 20:49:16 -06:00
Suggestions.pm Some reworking of suggestions management interface in preparation for tackling hdl's proposal of wider scope. Includes change to Suggestions.pm to enable passing of borrowernumber to the template. 2008-03-21 21:45:15 -05:00
UploadedFile.pm C4 - BEGIN blocks and 1; __END__ for modules 2008-01-07 20:02:18 -06:00
Utils.pm Big LDAP changes, module test for Context.pm, still more yet to come. 2007-12-04 17:27:06 -06:00
VirtualShelves.pm Shelves - fixup display, in particular intranet side 2008-02-22 21:49:06 -06:00
XISBN.pm adding famfamfam iconset, improving isbn for amazon content, etc. 2008-04-07 21:20:22 -05:00
XSLT.pm Partial fixes to enable unapi for non-zebra and non-public-facing sru 2008-04-08 19:48:55 -05:00
Z3950.pm Z3950.pm - BEGIN block VERSION and vars related to export. 2008-01-07 20:02:50 -06:00