Bugzilla – Attachment 161264 Details for
Bug 35870
Adding an edit_authorities subpermission for editauthorities
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35870: Adding new subpermission edit_authorities
Bug-35870-Adding-new-subpermission-editauthorities.patch (text/plain), 7.75 KB, created by
Wainui Witika-Park
on 2024-01-23 03:46:35 UTC
(
hide
)
Description:
Bug 35870: Adding new subpermission edit_authorities
Filename:
MIME Type:
Creator:
Wainui Witika-Park
Created:
2024-01-23 03:46:35 UTC
Size:
7.75 KB
patch
obsolete
>From e3267df6ffa66b7d139f77548b8aae2c32d453c8 Mon Sep 17 00:00:00 2001 >From: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz> >Date: Tue, 23 Jan 2024 16:07:08 +1300 >Subject: [PATCH] Bug 35870: Adding new subpermission edit_authorities > >Sponsored-by: Education Services Australia SCIS >--- > authorities/authorities.pl | 2 +- > ...g_35870_add_edit_authorities_subpermission | 22 +++++++++++++++++++ > .../data/mysql/mandatory/userpermissions.sql | 1 + > .../prog/en/includes/authorities-toolbar.inc | 6 ++--- > .../prog/en/includes/permissions.inc | 5 +++++ > .../authorities/searchresultlist-auth.tt | 4 +++- > .../modules/authorities/searchresultlist.tt | 4 ++-- > 7 files changed, 37 insertions(+), 7 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_35870_add_edit_authorities_subpermission > >diff --git a/authorities/authorities.pl b/authorities/authorities.pl >index bd20fd6374..92a896e64a 100755 >--- a/authorities/authorities.pl >+++ b/authorities/authorities.pl >@@ -558,7 +558,7 @@ my ($template, $loggedinuser, $cookie) > = get_template_and_user({template_name => "authorities/authorities.tt", > query => $input, > type => "intranet", >- flagsrequired => {editauthorities => 1}, >+ flagsrequired => { editauthorities => 'edit_authorities' }, > }); > $template->param(nonav => $nonav,index=>$myindex,authtypecode=>$authtypecode,breedingid=>$breedingid, count=>$count); > >diff --git a/installer/data/mysql/atomicupdate/bug_35870_add_edit_authorities_subpermission b/installer/data/mysql/atomicupdate/bug_35870_add_edit_authorities_subpermission >new file mode 100755 >index 0000000000..34ed454751 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_35870_add_edit_authorities_subpermission >@@ -0,0 +1,22 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "35870", >+ description => "Adding an edit_authorities subpermission for editauthorities", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ # Do you stuffs here >+ $DBversion = 'XXX'; >+ if( CheckVersion( $DBversion ) ) { >+ $dbh->do(q{INSERT IGNORE INTO permissions (module_bit, code, description) VALUES ('14','edit_authorities','Edit authority records')}); >+ >+ NewVersion( $DBversion, undef, "Bug 35870: Add edit_authorities user subpermission" ); >+ } >+ >+ # Print useful stuff here >+ # permissions >+ say $out "Added new permission 'edit_authorities'"; >+ }, >+}; >diff --git a/installer/data/mysql/mandatory/userpermissions.sql b/installer/data/mysql/mandatory/userpermissions.sql >index 7e52abd262..da8c8ab4e9 100644 >--- a/installer/data/mysql/mandatory/userpermissions.sql >+++ b/installer/data/mysql/mandatory/userpermissions.sql >@@ -119,6 +119,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES > (13, 'access_files', 'Access to the files stored on the server'), > (13, 'upload_general_files', 'Upload any file'), > (13, 'upload_manage', 'Manage uploaded files'), >+ (14, 'edit_authorities', 'Edit authority records'), > (15, 'check_expiration', 'Check the expiration of a serial'), > (15, 'claim_serials', 'Claim missing serials'), > (15, 'create_subscription', 'Create a new subscription'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc >index 58b7ca715e..4d07f678b4 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc >@@ -1,8 +1,8 @@ > [% INCLUDE 'blocking_errors.inc' %] >-[% IF ( authid || CAN_user_editauthorities) %] >+[% IF ( authid || CAN_user_editauthorities_edit_authorities ) %] > > <div id="toolbar" class="btn-toolbar"> >- [% IF ( CAN_user_editauthorities ) %] >+ [% IF ( CAN_user_editauthorities_edit_authorities ) %] > <div class="btn-group"> > <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"> > <i class="fa fa-plus"></i> New authority >@@ -24,7 +24,7 @@ > [% END %] > > [% IF ( authid ) %] >- [% IF ( CAN_user_editauthorities ) %] >+ [% IF ( CAN_user_editauthorities_edit_authorities ) %] > <div class="btn-group"> > <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"> > <i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit <span class="caret"></span> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >index 10b90813f4..b1c75e30ff 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc >@@ -617,6 +617,11 @@ > Manage rotating collections > </span> > <span class="permissioncode">([% name | html %])</span> >+ [%- CASE 'edit_authorities' -%] >+ <span class="sub_permission edit_authorities"> >+ Edit authority records >+ </span> >+ <span class="permissioncode">([% name | html %])</span> > [%- CASE 'schedule_tasks' -%] > <span class="sub_permission schedule_tasks_subpermission"> > Schedule tasks to run >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt >index c063817a0f..4e11c54d76 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt >@@ -95,7 +95,9 @@ > <a class="btn btn-xs btn-default" href="javascript:doauth('[% resul.authid | html %]', '[% index | html %]', '')"><i class="fa fa-plus"></i> Choose</a> > [% END %] > </td> >- <td><a class="btn btn-xs btn-default" href="authorities.pl?authid=[% resul.authid | html %]"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit authority</a></td> >+ [% IF CAN_user_editauthorities_edit_authorities %] >+ <td><a class="btn btn-xs btn-default edit-authority" id="[% resul.authid | html %]" href="authorities.pl?authid=[% resul.authid | html %]"><i class="fa fa-pencil"></i> Edit authority</a></td> >+ [% END %] > </tr> > [% END %] > </table> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt >index 6d5baf41e4..b4627a6e23 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt >@@ -70,7 +70,7 @@ > [% IF Koha.Preference('ShowHeadingUse') %] > <th class="heading_use">Heading use</th> > [% END %] >- [% IF ( CAN_user_editauthorities ) %] >+ [% IF ( CAN_user_editauthorities_edit_authorities ) %] > <th> </th> > [% END %] > </tr> >@@ -100,7 +100,7 @@ > <li>[% IF resul.series %]<i class="fa fa-check"></i>[% ELSE %]<i class="fa fa-times"></i>[% END %] Series Title</li> > </ul></td> > [% END %] >- [% IF ( CAN_user_editauthorities ) %] >+ [% IF ( CAN_user_editauthorities_edit_authorities ) %] > <td> > <div class="btn-group dropup"> > <a class="btn btn-default btn-xs dropdown-toggle" id="authactions[% resul.authid | html %]" role="button" data-toggle="dropdown" href="#"> >-- >2.30.2
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 35870
:
161264
|
161317