Bugzilla – Attachment 124445 Details for
Bug 28882
Incorrect permissions check client-side
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28882: Disable select/hide all links
Bug-28882-Disable-selecthide-all-links.patch (text/plain), 3.50 KB, created by
Hayley Pelham
on 2021-09-03 01:31:15 UTC
(
hide
)
Description:
Bug 28882: Disable select/hide all links
Filename:
MIME Type:
Creator:
Hayley Pelham
Created:
2021-09-03 01:31:15 UTC
Size:
3.50 KB
patch
obsolete
>From a9e2a23aefd71228c8e28b43c137e2ed3680832d Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 25 Aug 2021 11:47:18 +0200 >Subject: [PATCH] Bug 28882: Disable select/hide all links > >We want to prevent non-superlibrarian users to remove superlibrarian >flag. >It's handled already in the controller, but needs to be done >client-side. > >Here we are disabling the select/hide all links to remove the remaining >possibility to remove the superlibrarian flag from non-superlibrarian >users. > >Signed-off-by: Hayley Pelham <hayleypelham@catalyst.net.nz> >--- > .../prog/en/modules/members/member-flags.tt | 51 ++++++++++++---------- > 1 file changed, 29 insertions(+), 22 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt >index d2f4156f51..6acb98bceb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-flags.tt >@@ -127,28 +127,35 @@ > var Sticky; > $(document).ready(function() { > >- $("#CheckAllFlags").on("click",function(){ >- $(".flag").attr("disabled", false); >- $(".flag").prop("checked", true); >- $("#flag-0").prop("checked", false); >- [% IF disable_superlibrarian_privs %] >- $("#flag-0").prop("disabled", true); >- [% END %] >- return false; >- }); >- $("#UncheckAllFlags").on("click",function(){ >- $(".flag").attr("disabled", false); >- [% IF disable_superlibrarian_privs %] >- $("#flag-0").prop("disabled", true); >- [% END %] >- $(".flag").prop("checked", false); >- return false; >- }); >- $(".flag").change(function(){ >- if(!$(this).is(':checked')){ >- $("input#flag-0").prop("checked", false); >- } >- }); >+ [% IF disable_superlibrarian_privs && patron.is_superlibrarian %] >+ $("#CheckAllFlags,#UncheckAllFlags") >+ .attr("disabled", true) >+ .attr("title", _("The system preference ProtectSuperlibrarian is enabled")) >+ .on("click", function(e){e.preventDefault()}); >+ [% ELSE %] >+ $("#CheckAllFlags").on("click",function(){ >+ $(".flag").attr("disabled", false); >+ $(".flag").prop("checked", true); >+ $("#flag-0").prop("checked", false); >+ [% IF disable_superlibrarian_privs %] >+ $("#flag-0").prop("disabled", true); >+ [% END %] >+ return false; >+ }); >+ $("#UncheckAllFlags").on("click",function(){ >+ $(".flag").attr("disabled", false); >+ [% IF disable_superlibrarian_privs %] >+ $("#flag-0").prop("disabled", true); >+ [% END %] >+ $(".flag").prop("checked", false); >+ return false; >+ }); >+ $(".flag").change(function(){ >+ if(!$(this).is(':checked')){ >+ $("input#flag-0").prop("checked", false); >+ } >+ }); >+ [% END %] > > Sticky = $("#permissions_toolbar"); > Sticky.hcSticky({ >-- >2.11.0
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 28882
:
123972
|
124082
|
124443
|
124444
|
124445
|
124558
|
124559