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

(-)a/authorities/authorities.pl (-1 / +1 lines)
Lines 568-574 my ( $template, $loggedinuser, $cookie ) = get_template_and_user( Link Here
568
        template_name => "authorities/authorities.tt",
568
        template_name => "authorities/authorities.tt",
569
        query         => $input,
569
        query         => $input,
570
        type          => "intranet",
570
        type          => "intranet",
571
        flagsrequired => { editauthorities => 1 },
571
        flagsrequired => { editauthorities => 'edit_authorities' },
572
    }
572
    }
573
);
573
);
574
$template->param( index => $myindex, authtypecode => $authtypecode, breedingid => $breedingid, count => $count );
574
$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 133-138 INSERT INTO permissions (module_bit, code, description) VALUES Link Here
133
   (13, 'access_files', 'Access to the files stored on the server'),
133
   (13, 'access_files', 'Access to the files stored on the server'),
134
   (13, 'upload_general_files', 'Upload any file'),
134
   (13, 'upload_general_files', 'Upload any file'),
135
   (13, 'upload_manage', 'Manage uploaded files'),
135
   (13, 'upload_manage', 'Manage uploaded files'),
136
   (14, 'edit_authorities', 'Edit authority records'),
136
   (15, 'check_expiration', 'Check the expiration of a serial'),
137
   (15, 'check_expiration', 'Check the expiration of a serial'),
137
   (15, 'claim_serials', 'Claim missing serials'),
138
   (15, 'claim_serials', 'Claim missing serials'),
138
   (15, 'create_subscription', 'Create a new subscription'),
139
   (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 454-459 Link Here
454
    [%- CASE 'rotating_collections' -%]
454
    [%- CASE 'rotating_collections' -%]
455
        <span class="sub_permission rotating_collections_subpermission"> Manage rotating collections </span>
455
        <span class="sub_permission rotating_collections_subpermission"> Manage rotating collections </span>
456
        <span class="permissioncode">([% name | html %])</span>
456
        <span class="permissioncode">([% name | html %])</span>
457
    [%- CASE 'edit_authorities' -%]
458
        <span class="sub_permission edit_authorities">
459
            Edit authority records
460
        </span>
461
        <span class="permissioncode">([% name | html %])</span>
457
    [%- CASE 'schedule_tasks' -%]
462
    [%- CASE 'schedule_tasks' -%]
458
        <span class="sub_permission schedule_tasks_subpermission"> Schedule tasks to run </span>
463
        <span class="sub_permission schedule_tasks_subpermission"> Schedule tasks to run </span>
459
        <span class="permissioncode">([% name | html %])</span>
464
        <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('[% line.authid | html %]', '[% index | html %]', '')"><i class="fa fa-plus"></i> Choose</a>
128
                                <a class="btn btn-xs btn-default" href="javascript:doauth('[% line.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=[% line.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=[% line.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[% line.authid | html %]" role="button" data-bs-toggle="dropdown" href="#"> Actions</a>
107
                                        <a class="btn btn-default btn-xs dropdown-toggle" id="authactions[% line.authid | html %]" role="button" data-bs-toggle="dropdown" href="#"> Actions</a>
108
- 

Return to bug 35870