Right now, it's possible to limit who can edit items by using IndependantBranches. However, Koha has no method of limiting who can edit bibliographic records, as they have no defined owner.
Created attachment 18174 [details] [review] Bug 10200 - Bug 10263 - Add ability to limit which branch can edit a bibliographic record ( IndependentBranchesMarcEditing ) Right now, it's possible to limit who can edit items by using IndependantBranches. However, Koha has no method of limiting who can edit bibliographic records, as they have no defined owner. This patch adds a new system preference IndependentBranchesMarcEditing. If this new syspref is enabled, a librarian can only edit or delete a bib record if his or her logged in branch code matches the branchcode in biblio.branchcode. This feature does not affect the ability to edit or delete items, as that functionality is determined by IndependantBranches. This patch adds the 'branches_optional' field to the authorised values pulldown for MARC fields and subfields in the MARC frameworks editor. 'branches_optional' behaves exactly like 'branches' except it includes an "empty" choice so the branch does not have to be set. Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) Map a nonrepeatable field/subfield to biblio.branchcode ( e.g. 951$o ) Pro-tip: Use the authorised value 'branches_optional' to get a pulldown of libraries instead of entering the branchcode manually. 4) Edit a record, and add a branchcode. 5) Log in as a non-superlibrarian with cataloging priveleges 6) Change the logged in branch to a branch other than the one you entered in the record. 7) You should note the 'edit' pulldown for the record is missing the "Edit record" and "Delete record" options. 8) Switch the logged in branch to match the branchcode of the record. 9) You should now see the edit and delete options for that record. 10) Attempt to edit a record with no branchcode defined, you should be able to.
Created attachment 18480 [details] [review] Bug 10200 - Bug 10263 - Add ability to limit which branch can edit a bibliographic record ( IndependentBranchesMarcEditing ) Right now, it's possible to limit who can edit items by using IndependantBranches. However, Koha has no method of limiting who can edit bibliographic records, as they have no defined owner. This patch adds a new system preference IndependentBranchesMarcEditing. If this new syspref is enabled, a librarian can only edit or delete a bib record if his or her logged in branch code matches the branchcode in biblio.branchcode. This feature does not affect the ability to edit or delete items, as that functionality is determined by IndependantBranches. This patch adds the 'branches_optional' field to the authorised values pulldown for MARC fields and subfields in the MARC frameworks editor. 'branches_optional' behaves exactly like 'branches' except it includes an "empty" choice so the branch does not have to be set. Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) Map a nonrepeatable field/subfield to biblio.branchcode ( e.g. 951$o ) Pro-tip: Use the authorised value 'branches_optional' to get a pulldown of libraries instead of entering the branchcode manually. 4) Edit a record, and add a branchcode. 5) Log in as a non-superlibrarian with cataloging priveleges 6) Change the logged in branch to a branch other than the one you entered in the record. 7) You should note the 'edit' pulldown for the record is missing the "Edit record" and "Delete record" options. 8) Switch the logged in branch to match the branchcode of the record. 9) You should now see the edit and delete options for that record. 10) Attempt to edit a record with no branchcode defined, you should be able to.
Created attachment 18521 [details] [review] Bug 10263 - Add ability to limit which branch can edit a bibliographic record ( IndependentBranchesMarcEditing ) Right now, it's possible to limit who can edit items by using IndependantBranches. However, Koha has no method of limiting who can edit bibliographic records, as they have no defined owner. This patch adds a new system preference IndependentBranchesMarcEditing. If this new syspref is enabled, a librarian can only edit or delete a bib record if his or her logged in branch code matches the branchcode in biblio.branchcode. This feature does not affect the ability to edit or delete items, as that functionality is determined by IndependantBranches. This patch adds the 'branches_optional' field to the authorised values pulldown for MARC fields and subfields in the MARC frameworks editor. 'branches_optional' behaves exactly like 'branches' except it includes an "empty" choice so the branch does not have to be set. Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) Map a nonrepeatable field/subfield to biblio.branchcode ( e.g. 951$o ) Pro-tip: Use the authorised value 'branches_optional' to get a pulldown of libraries instead of entering the branchcode manually. 4) Edit a record, and add a branchcode. 5) Log in as a non-superlibrarian with cataloging priveleges 6) Change the logged in branch to a branch other than the one you entered in the record. 7) You should note the 'edit' pulldown for the record is missing the "Edit record" and "Delete record" options. 8) Switch the logged in branch to match the branchcode of the record. 9) You should now see the edit and delete options for that record. 10) Attempt to edit a record with no branchcode defined, you should be able to.
Created attachment 18837 [details] [review] Bug 10263 - Add ability to limit which branch can edit a bibliographic record ( IndependentBranchesMarcEditing ) Right now, it's possible to limit who can edit items by using IndependantBranches. However, Koha has no method of limiting who can edit bibliographic records, as they have no defined owner. This patch adds a new system preference IndependentBranchesMarcEditing. If this new syspref is enabled, a librarian can only edit or delete a bib record if his or her logged in branch code matches the branchcode in biblio.branchcode. This feature does not affect the ability to edit or delete items, as that functionality is determined by IndependantBranches. This patch adds the 'branches_optional' field to the authorised values pulldown for MARC fields and subfields in the MARC frameworks editor. 'branches_optional' behaves exactly like 'branches' except it includes an "empty" choice so the branch does not have to be set. Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) Map a nonrepeatable field/subfield to biblio.branchcode ( e.g. 951$o ) Pro-tip: Use the authorised value 'branches_optional' to get a pulldown of libraries instead of entering the branchcode manually. 4) Edit a record, and add a branchcode. 5) Log in as a non-superlibrarian with cataloging priveleges 6) Change the logged in branch to a branch other than the one you entered in the record. 7) You should note the 'edit' pulldown for the record is missing the "Edit record" and "Delete record" options. 8) Switch the logged in branch to match the branchcode of the record. 9) You should now see the edit and delete options for that record. 10) Attempt to edit a record with no branchcode defined, you should be able to.
Created attachment 18848 [details] [review] Bug 10263 - Followup
Created attachment 18849 [details] [review] Bug 10263 - Add ability to limit which branch can edit a bibliographic record ( IndependentBranchesMarcEditing ) Right now, it's possible to limit who can edit items by using IndependantBranches. However, Koha has no method of limiting who can edit bibliographic records, as they have no defined owner. This patch adds a new system preference IndependentBranchesMarcEditing. If this new syspref is enabled, a librarian can only edit or delete a bib record if his or her logged in branch code matches the branchcode in biblio.branchcode. This feature does not affect the ability to edit or delete items, as that functionality is determined by IndependantBranches. This patch adds the 'branches_optional' field to the authorised values pulldown for MARC fields and subfields in the MARC frameworks editor. 'branches_optional' behaves exactly like 'branches' except it includes an "empty" choice so the branch does not have to be set. Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) Map a nonrepeatable field/subfield to biblio.branchcode ( e.g. 951$o ) Pro-tip: Use the authorised value 'branches_optional' to get a pulldown of libraries instead of entering the branchcode manually. 4) Edit a record, and add a branchcode. 5) Log in as a non-superlibrarian with cataloging priveleges 6) Change the logged in branch to a branch other than the one you entered in the record. 7) You should note the 'edit' pulldown for the record is missing the "Edit record" and "Delete record" options. 8) Switch the logged in branch to match the branchcode of the record. 9) You should now see the edit and delete options for that record. 10) Attempt to edit a record with no branchcode defined, you should be able to.
Created attachment 20775 [details] [review] Bug 10263 - Add ability to limit which branch can edit a bibliographic record ( IndependentBranchesMarcEditing ) Right now, it's possible to limit who can edit items by using IndependantBranches. However, Koha has no method of limiting who can edit bibliographic records, as they have no defined owner. This patch adds a new system preference IndependentBranchesMarcEditing. If this new syspref is enabled, a librarian can only edit or delete a bib record if his or her logged in branch code matches the branchcode in biblio.branchcode. This feature does not affect the ability to edit or delete items, as that functionality is determined by IndependantBranches. This patch adds the 'branches_optional' field to the authorised values pulldown for MARC fields and subfields in the MARC frameworks editor. 'branches_optional' behaves exactly like 'branches' except it includes an "empty" choice so the branch does not have to be set. Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) Map a nonrepeatable field/subfield to biblio.branchcode ( e.g. 951$o ) Pro-tip: Use the authorised value 'branches_optional' to get a pulldown of libraries instead of entering the branchcode manually. 4) Edit a record, and add a branchcode. 5) Log in as a non-superlibrarian with cataloging priveleges 6) Change the logged in branch to a branch other than the one you entered in the record. 7) You should note the 'edit' pulldown for the record is missing the "Edit record" and "Delete record" options. 8) Switch the logged in branch to match the branchcode of the record. 9) You should now see the edit and delete options for that record. 10) Attempt to edit a record with no branchcode defined, you should be able to.
Created attachment 21147 [details] [review] Bug 10263 - Add ability to limit which branch can edit a bibliographic record ( IndependentBranchesMarcEditing ) Right now, it's possible to limit who can edit items by using IndependantBranches. However, Koha has no method of limiting who can edit bibliographic records, as they have no defined owner. This patch adds a new system preference IndependentBranchesMarcEditing. If this new syspref is enabled, a librarian can only edit or delete a bib record if his or her logged in branch code matches the branchcode in biblio.branchcode. This feature does not affect the ability to edit or delete items, as that functionality is determined by IndependantBranches. This patch adds the 'branches_optional' field to the authorised values pulldown for MARC fields and subfields in the MARC frameworks editor. 'branches_optional' behaves exactly like 'branches' except it includes an "empty" choice so the branch does not have to be set. Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) Map a nonrepeatable field/subfield to biblio.branchcode ( e.g. 951$o ) Pro-tip: Use the authorised value 'branches_optional' to get a pulldown of libraries instead of entering the branchcode manually. 4) Edit a record, and add a branchcode. 5) Log in as a non-superlibrarian with cataloging priveleges 6) Change the logged in branch to a branch other than the one you entered in the record. 7) You should note the 'edit' pulldown for the record is missing the "Edit record" and "Delete record" options. 8) Switch the logged in branch to match the branchcode of the record. 9) You should now see the edit and delete options for that record. 10) Attempt to edit a record with no branchcode defined, you should be able to.
Applying: Bug 10263 - Add ability to limit which branch can edit a bibliographic record ( IndependentBranchesMarcEditing ) Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 Bug 10263 - Add ability to limit which branch can edit a bibliographic record ( IndependentBranchesMarcEditing ) The copy of the patch that failed is found in: /home/christopher/git/koha/.git/rebase-apply/patch When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".
Created attachment 23491 [details] [review] Bug 10263 - Add ability to limit which branch can edit a bibliographic record ( IndependentBranchesMarcEditing ) Right now, it's possible to limit who can edit items by using IndependantBranches. However, Koha has no method of limiting who can edit bibliographic records, as they have no defined owner. This patch adds a new system preference IndependentBranchesMarcEditing. If this new syspref is enabled, a librarian can only edit or delete a bib record if his or her logged in branch code matches the branchcode in biblio.branchcode. This feature does not affect the ability to edit or delete items, as that functionality is determined by IndependantBranches. This patch adds the 'branches_optional' field to the authorised values pulldown for MARC fields and subfields in the MARC frameworks editor. 'branches_optional' behaves exactly like 'branches' except it includes an "empty" choice so the branch does not have to be set. Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) Map a nonrepeatable field/subfield to biblio.branchcode ( e.g. 951$o ) Pro-tip: Use the authorised value 'branches_optional' to get a pulldown of libraries instead of entering the branchcode manually. 4) Edit a record, and add a branchcode. 5) Log in as a non-superlibrarian with cataloging priveleges 6) Change the logged in branch to a branch other than the one you entered in the record. 7) You should note the 'edit' pulldown for the record is missing the "Edit record" and "Delete record" options. 8) Switch the logged in branch to match the branchcode of the record. 9) You should now see the edit and delete options for that record. 10) Attempt to edit a record with no branchcode defined, you should be able to.
Created attachment 23636 [details] [review] Bug 10263 - Add ability to limit which branch can edit a bibliographic record ( IndependentBranchesMarcEditing ) Right now, it's possible to limit who can edit items by using IndependantBranches. However, Koha has no method of limiting who can edit bibliographic records, as they have no defined owner. This patch adds a new system preference IndependentBranchesMarcEditing. If this new syspref is enabled, a librarian can only edit or delete a bib record if his or her logged in branch code matches the branchcode in biblio.branchcode. This feature does not affect the ability to edit or delete items, as that functionality is determined by IndependantBranches. This patch adds the 'branches_optional' field to the authorised values pulldown for MARC fields and subfields in the MARC frameworks editor. 'branches_optional' behaves exactly like 'branches' except it includes an "empty" choice so the branch does not have to be set. Test Plan: 1) Apply patch 2) Run updatedatabase.pl 3) Map a nonrepeatable field/subfield to biblio.branchcode ( e.g. 951$o ) Pro-tip: Use the authorised value 'branches_optional' to get a pulldown of libraries instead of entering the branchcode manually. 4) Edit a record, and add a branchcode. 5) Log in as a non-superlibrarian with cataloging priveleges 6) Change the logged in branch to a branch other than the one you entered in the record. 7) You should note the 'edit' pulldown for the record is missing the "Edit record" and "Delete record" options. 8) Switch the logged in branch to match the branchcode of the record. 9) You should now see the edit and delete options for that record. 10) Attempt to edit a record with no branchcode defined, you should be able to.
I tested this and want to sign off on it. Joel Sasse
Created attachment 23639 [details] [review] Bug 10263 - Add ability to limit which branch can edit a bibliographic record (IndependentBranchesMarcEditing)
Comment on attachment 23639 [details] [review] Bug 10263 - Add ability to limit which branch can edit a bibliographic record (IndependentBranchesMarcEditing) Review of attachment 23639 [details] [review]: ----------------------------------------------------------------- Doing some code review here too... 1) I think instead of using a new separate authorised value entry to have an empty option, this could work like the item form. If you mark the subfield mandatory, it will not offer an empty option. If it's not mandatory, it will. But it looks like the rule does not apply to the cataloguing form yet, as 942$c (itemtype) offers an empty option and is mandatory. Hm. 2) HasIndependentGroupModificationRightsFor needs some unit tests and documentation. Why is $self ignored? Why not use GetIndependentGroupModificationRights( { for => $branchcode } );? 3) Spotted another 'old' superlibrarian permission check. Failing for 2), 3) might be resolved by one of the other dependent patches. ::: C4/Auth.pm @@ +197,3 @@ > # to create the template's parameters that will indicate > # which menus the user can access. > if ( $flags && $flags->{superlibrarian}==1 ) { Old check for superlibrarian permission. ::: Koha/Template/Plugin/Koha.pm @@ +44,4 @@ > return C4::Context->preference( $pref ); > } > > +sub HasIndependentGroupModificationRightsFor { POD, UT ::: admin/marc_subfields_structure.pl @@ +133,4 @@ > push @authorised_values, $category; > } > push( @authorised_values, "branches" ); > + push( @authorised_values, "branches_optional" ); See 1) for an idea to handle this a bit differently. ::: installer/data/mysql/kohastructure.sql @@ +127,4 @@ > `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this record was last touched > `datecreated` DATE NOT NULL, -- the date this record was added to Koha > `abstract` mediumtext, -- summary from the MARC record (520$a in MARC21) > + `branchcode` VARCHAR( 10 ) NULL DEFAULT NULL, -- branchcode for the opationl 'owner' of this record. Small documentation typo.
*** This bug has been marked as a duplicate of bug 28743 ***