Bugzilla – Attachment 124082 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.43 KB, created by
Jonathan Druart
on 2021-08-25 09:50:12 UTC
(
hide
)
Description:
Bug 28882: Disable select/hide all links
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2021-08-25 09:50:12 UTC
Size:
3.43 KB
patch
obsolete
>From 7cb11ffe0346e19972387bfb6fb6a30c458bd866 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. >--- > .../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 d2f4156f51d..6acb98bceb6 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.25.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 28882
:
123972
|
124082
|
124443
|
124444
|
124445
|
124558
|
124559