View | Details | Raw Unified | Return to bug 35870
Collapse All | Expand All

(-)a/authorities/authorities.pl (-1 / +1 lines)
Lines 564-570 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
564
        template_name => "authorities/authorities.tt",
564
        template_name => "authorities/authorities.tt",
565
        query         => $input,
565
        query         => $input,
566
        type          => "intranet",
566
        type          => "intranet",
567
        flagsrequired => { editauthorities => 1 },
567
        flagsrequired => { editauthorities => 'edit_authorities' },
568
    }
568
    }
569
);
569
);
570
$template->param( index => $myindex, authtypecode => $authtypecode, breedingid => $breedingid, count => $count );
570
$template->param( index => $myindex, authtypecode => $authtypecode, breedingid => $breedingid, count => $count );
(-)a/installer/data/mysql/atomicupdate/bug_35870_add_edit_authorities_subpermission.pl (+17 lines)
Line 0 Link Here
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_success say_info);
3
4
return {
5
    bug_number  => "35870",
6
    description => "Adding an edit_authorities subpermission for editauthorities",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11
        $dbh->do(
12
            q{INSERT IGNORE INTO permissions (module_bit, code, description) VALUES ('14','edit_authorities','Edit authority records')}
13
        );
14
15
        say_success( $out, "Added new permission 'edit_authorities'" );
16
    },
17
};
(-)a/installer/data/mysql/mandatory/userpermissions.sql (+1 lines)
Lines 127-132 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
127
   (13, 'access_files', 'Access to the files stored on the server'),
127
   (13, 'access_files', 'Access to the files stored on the server'),
128
   (13, 'upload_general_files', 'Upload any file'),
128
   (13, 'upload_general_files', 'Upload any file'),
129
   (13, 'upload_manage', 'Manage uploaded files'),
129
   (13, 'upload_manage', 'Manage uploaded files'),
130
   (14, 'edit_authorities', 'Edit authority records'),
130
   (15, 'check_expiration', 'Check the expiration of a serial'),
131
   (15, 'check_expiration', 'Check the expiration of a serial'),
131
   (15, 'claim_serials', 'Claim missing serials'),
132
   (15, 'claim_serials', 'Claim missing serials'),
132
   (15, 'create_subscription', 'Create a new subscription'),
133
   (15, 'create_subscription', 'Create a new subscription'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc (-3 / +3 lines)
Lines 1-6 Link Here
1
[% IF ( authid || CAN_user_editauthorities) %]
1
[% IF ( authid || CAN_user_editauthorities_edit_authorities ) %]
2
    <div id="toolbar" class="btn-toolbar sticky">
2
    <div id="toolbar" class="btn-toolbar sticky">
3
        [% IF ( CAN_user_editauthorities ) %]
3
        [% IF ( CAN_user_editauthorities_edit_authorities ) %]
4
            <div class="btn-group">
4
            <div class="btn-group">
5
                <button class="btn btn-default dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> <i class="fa fa-plus"></i> New authority </button>
5
                <button class="btn btn-default dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> <i class="fa fa-plus"></i> New authority </button>
6
                <ul class="dropdown-menu">
6
                <ul class="dropdown-menu">
Lines 17-23 Link Here
17
        [% END %]
17
        [% END %]
18
18
19
        [% IF ( authid ) %]
19
        [% IF ( authid ) %]
20
            [% IF ( CAN_user_editauthorities ) %]
20
            [% IF ( CAN_user_editauthorities_edit_authorities ) %]
21
                <div class="btn-group">
21
                <div class="btn-group">
22
                    <button class="btn btn-default dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> <i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit </button>
22
                    <button class="btn btn-default dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> <i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit </button>
23
                    <ul class="dropdown-menu">
23
                    <ul class="dropdown-menu">
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc (+5 lines)
Lines 433-438 Link Here
433
    [%- CASE 'rotating_collections' -%]
433
    [%- CASE 'rotating_collections' -%]
434
        <span class="sub_permission rotating_collections_subpermission"> Manage rotating collections </span>
434
        <span class="sub_permission rotating_collections_subpermission"> Manage rotating collections </span>
435
        <span class="permissioncode">([% name | html %])</span>
435
        <span class="permissioncode">([% name | html %])</span>
436
    [%- CASE 'edit_authorities' -%]
437
        <span class="sub_permission edit_authorities">
438
            Edit authority records
439
        </span>
440
        <span class="permissioncode">([% name | html %])</span>
436
    [%- CASE 'schedule_tasks' -%]
441
    [%- CASE 'schedule_tasks' -%]
437
        <span class="sub_permission schedule_tasks_subpermission"> Schedule tasks to run </span>
442
        <span class="sub_permission schedule_tasks_subpermission"> Schedule tasks to run </span>
438
        <span class="permissioncode">([% name | html %])</span>
443
        <span class="permissioncode">([% name | html %])</span>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt (-3 / +5 lines)
Lines 128-136 Link Here
128
                                <a class="btn btn-xs btn-default" href="javascript:doauth('[% resul.authid | html %]', '[% index | html %]', '')"><i class="fa fa-plus"></i> Choose</a>
128
                                <a class="btn btn-xs btn-default" href="javascript:doauth('[% resul.authid | html %]', '[% index | html %]', '')"><i class="fa fa-plus"></i> Choose</a>
129
                            [% END %]
129
                            [% END %]
130
                        </td>
130
                        </td>
131
                        <td
131
                        <td>
132
                            ><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
132
                            [% IF CAN_user_editauthorities_edit_authorities %]
133
                        >
133
                                <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>
134
                            [% END %]
135
                        </td>
134
                    </tr>
136
                    </tr>
135
                [% END %]
137
                [% END %]
136
            </table>
138
            </table>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt (-3 / +2 lines)
Lines 69-75 Link Here
69
                        [% IF Koha.Preference('ShowHeadingUse') %]
69
                        [% IF Koha.Preference('ShowHeadingUse') %]
70
                            <th class="heading_use">Heading use</th>
70
                            <th class="heading_use">Heading use</th>
71
                        [% END %]
71
                        [% END %]
72
                        [% IF ( CAN_user_editauthorities ) %]
72
                        [% IF ( CAN_user_editauthorities_edit_authorities ) %]
73
                            <th>&nbsp;</th>
73
                            <th>&nbsp;</th>
74
                        [% END %]
74
                        [% END %]
75
                    </tr>
75
                    </tr>
Lines 101-107 Link Here
101
                                    </ul></td
101
                                    </ul></td
102
                                >
102
                                >
103
                            [% END %]
103
                            [% END %]
104
                            [% IF ( CAN_user_editauthorities ) %]
104
                            [% IF ( CAN_user_editauthorities_edit_authorities ) %]
105
                                <td>
105
                                <td>
106
                                    <div class="btn-group dropup">
106
                                    <div class="btn-group dropup">
107
                                        <a class="btn btn-default btn-xs dropdown-toggle" id="authactions[% resul.authid | html %]" role="button" data-bs-toggle="dropdown" href="#"> Actions</a>
107
                                        <a class="btn btn-default btn-xs dropdown-toggle" id="authactions[% resul.authid | html %]" role="button" data-bs-toggle="dropdown" href="#"> Actions</a>
108
- 

Return to bug 35870