Bugzilla – Attachment 139125 Details for
Bug 15326
Add CMS feature
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15326: (follow-up) Fix staff permissions and consider library limits
Bug-15326-follow-up-Fix-staff-permissions-and-cons.patch (text/plain), 2.75 KB, created by
Owen Leonard
on 2022-08-15 12:20:52 UTC
(
hide
)
Description:
Bug 15326: (follow-up) Fix staff permissions and consider library limits
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2022-08-15 12:20:52 UTC
Size:
2.75 KB
patch
obsolete
>From d765f164c65879ce67a0b75d06997f6449d05b88 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Mon, 15 Aug 2022 17:31:57 +1200 >Subject: [PATCH] Bug 15326: (follow-up) Fix staff permissions and consider > library limits > >To test: >1. Take note of what your logged in library is >2. Add a new page that can be viewed on the OPAC and staff interface. >Limit the library to a different library, not your logged in library >3. Use a News item to create a hyperlink to your new page on the OPAC >and staff interface. >4. Confirm that a page error shows if you try to view the new page. >5. Edit the new page and set the library to All libraries. >6. Try to go to the new page again and confirm it shows. >7. Log out and log back into the staff interface as a staff user that >isn't a superlibrarian >8. Confirm you can view the new page as this user > >Sponsored-by: Horowhenua Libraries Trust > >Signed-off-by: Owen Leonard <oleonard@myacpl.org> >--- > opac/opac-page.pl | 7 ++++++- > tools/page.pl | 5 +++-- > 2 files changed, 9 insertions(+), 3 deletions(-) > >diff --git a/opac/opac-page.pl b/opac/opac-page.pl >index d58057e4ec..7a4737df87 100755 >--- a/opac/opac-page.pl >+++ b/opac/opac-page.pl >@@ -36,8 +36,13 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > my $page_id = $query->param('page_id'); > my $page; > >+my $homebranch = $ENV{OPAC_BRANCH_DEFAULT}; >+if (C4::Context->userenv) { >+ $homebranch = C4::Context->userenv->{'branch'}; >+} >+ > if (defined $page_id){ >- $page = Koha::AdditionalContents->search({ idnew => $page_id, location => ['opac_only', 'staff_and_opac'] }); >+ $page = Koha::AdditionalContents->search({ idnew => $page_id, location => ['opac_only', 'staff_and_opac'], branchcode => [ $homebranch, undef ] }); > if ( $page->count > 0){ > $template->param( page => $page->next ); > } else { >diff --git a/tools/page.pl b/tools/page.pl >index 3933e1ea69..0cec1e7da3 100755 >--- a/tools/page.pl >+++ b/tools/page.pl >@@ -28,7 +28,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( > template_name => "tools/page.tt", > query => $query, > type => "intranet", >- flagsrequired => { tools => '*' }, >+ flagsrequired => { catalogue => 1 }, > } > ); > >@@ -36,7 +36,8 @@ my $page_id = $query->param('page_id'); > my $page; > > if (defined $page_id){ >- $page = Koha::AdditionalContents->search({ idnew => $page_id, location => ['staff_only', 'staff_and_opac'] }); >+ my $branch = C4::Context->userenv->{'branch'}; >+ $page = Koha::AdditionalContents->search({ idnew => $page_id, location => ['staff_only', 'staff_and_opac'], branchcode => [ $branch, undef ] }); > if ( $page->count > 0){ > $template->param( page => $page->next ); > } else { >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15326
:
45621
|
58272
|
58607
|
58608
|
58609
|
58787
|
63904
|
63905
|
64241
|
64941
|
64942
|
66255
|
70866
|
70867
|
70868
|
70869
|
70870
|
70871
|
76387
|
76388
|
76389
|
76390
|
76391
|
76392
|
78232
|
78233
|
78234
|
78235
|
78236
|
78237
|
78238
|
78240
|
79269
|
83318
|
83319
|
83320
|
83321
|
83322
|
83323
|
83324
|
83325
|
83326
|
83404
|
83405
|
83406
|
83407
|
83408
|
83409
|
83410
|
83411
|
83412
|
84682
|
84683
|
84684
|
84685
|
84686
|
84687
|
84688
|
84689
|
84690
|
84691
|
87494
|
87495
|
87496
|
87497
|
87498
|
87499
|
87500
|
87501
|
87502
|
87503
|
87608
|
87609
|
87610
|
87617
|
96084
|
96085
|
96086
|
96087
|
96088
|
96089
|
96090
|
96091
|
96092
|
96093
|
96094
|
96095
|
96096
|
96097
|
96098
|
97237
|
101565
|
101566
|
101567
|
101568
|
101569
|
101570
|
101571
|
101572
|
101573
|
101574
|
101575
|
101576
|
101577
|
101578
|
101579
|
101580
|
128341
|
128342
|
128343
|
128344
|
128345
|
128346
|
128347
|
128348
|
128349
|
128350
|
128351
|
128352
|
128353
|
128354
|
128355
|
128356
|
128357
|
128585
|
128642
|
136432
|
136757
|
136768
|
138489
|
138493
|
139028
|
139029
|
139030
|
139031
|
139111
|
139123
|
139124
|
139125
|
139172
|
139173
|
139174