MT2582: Fix user deletion without permission
This commit is contained in:
parent
899156b3ec
commit
29aa287c58
|
|
@ -63,7 +63,7 @@ function update_child() {
|
|||
<!-- TMPL_UNLESS NAME="CAN_user_staffaccess" -->, disabled: true<!-- /TMPL_UNLESS-->
|
||||
<!-- TMPL_ELSE --><!-- /TMPL_IF -->
|
||||
<!-- TMPL_ELSE -->, disabled: true<!-- /TMPL_IF-->},
|
||||
{ text: _("Delete"), <!-- TMPL_IF NAME="StaffMember" --><!-- TMPL_UNLESS NAME="CAN_user_staffaccess" -->disabled: true, <!-- /TMPL_UNLESS --><!-- /TMPL_IF --> onclick: { fn: confirm_deletion } },
|
||||
{ text: _("Delete"), <!-- TMPL_IF NAME="StaffMember" --><!-- TMPL_UNLESS NAME="CAN_user_staffaccess" -->disabled: true, <!-- /TMPL_UNLESS --><!-- TMPL_ELSE --><!-- TMPL_UNLESS NAME="CAN_user_borrowers" -->disabled: true, <!-- /TMPL_UNLESS --><!-- /TMPL_IF --> onclick: { fn: confirm_deletion } },
|
||||
{ text: _("Update Child to Adult Patron") , onclick: { fn: update_child }<!-- TMPL_UNLESS NAME="is_child" -->, disabled: true<!-- /TMPL_UNLESS -->}
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -49,11 +49,19 @@ my $countissues = scalar(@$issues);
|
|||
my ($bor)=GetMemberDetails($member,'');
|
||||
my $flags=$bor->{flags};
|
||||
my $userenv = C4::Context->userenv;
|
||||
|
||||
|
||||
|
||||
if ($bor->{category_type} eq "S") {
|
||||
unless(C4::Auth::haspermission($userenv->{'id'},{'staffaccess'=>1})) {
|
||||
print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$member&error=CANT_DELETE_STAFF");
|
||||
exit 1;
|
||||
}
|
||||
} else {
|
||||
unless(C4::Auth::haspermission($userenv->{'id'},{'borrowers'=>1})) {
|
||||
print $input->redirect("/cgi-bin/koha/members/moremember.pl?borrowernumber=$member&error=CANT_DELETE");
|
||||
exit 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (C4::Context->preference("IndependantBranches")) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue