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

(-)a/Koha/Template/Plugin/Koha.pm (-20 lines)
Lines 87-112 sub MultivaluePreference { Link Here
87
    return C4::Context->multivalue_preference($pref);
87
    return C4::Context->multivalue_preference($pref);
88
}
88
}
89
89
90
=head3 debug_flag
91
92
This method checks if the currently logged in user is allowed
93
access to the new debug ui permission. It should return
94
0 if no one is logged in or context is unavailable for some other reason
95
    or they do not have the permission
96
1 if they are a superlibrarian
97
1<<32 if they do have the permission
98
99
=cut
100
101
sub debug_flag {
102
    return 0 unless C4::Context->userenv();
103
    return 1 if C4::Context->IsSuperLibrarian();
104
    my $flags = C4::Context->userenv()->{'flags'};
105
    my $mask  = 1 << 32;
106
    return $flags & $mask;
107
108
}
109
110
=head3 CSVDelimiter
90
=head3 CSVDelimiter
111
91
112
The delimiter option 'tabs' is stored in the DB as 'tabulation' to avoid issues
92
The delimiter option 'tabs' is stored in the DB as 'tabulation' to avoid issues
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/header.inc (-1 / +1 lines)
Lines 248-254 Link Here
248
                            </li>
248
                            </li>
249
                        </ul>
249
                        </ul>
250
                    </li>
250
                    </li>
251
                    [% IF Koha.debug_flag %]
251
                    [% IF logged_in_user.has_permission({debug => 1}) %]
252
                        <li class="nav-item dropdown" id="debug-controls-dropdown">
252
                        <li class="nav-item dropdown" id="debug-controls-dropdown">
253
                            <a id="debug-controls-menu" href="#" class="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdown" aria-expanded="false" title="Debug controls">
253
                            <a id="debug-controls-menu" href="#" class="nav-link dropdown-toggle" role="button" data-bs-toggle="dropdown" aria-expanded="false" title="Debug controls">
254
                                <i id="debug-icon" class="fa fa-bug"></i>
254
                                <i id="debug-icon" class="fa fa-bug"></i>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/intranet-bottom.inc (-2 / +1 lines)
Lines 186-192 Link Here
186
    [% END %]
186
    [% END %]
187
[% END %]
187
[% END %]
188
188
189
[% IF Koha.debug_flag %]
189
[% IF logged_in_user.has_permission({debug => 1}) %]
190
    <script>
190
    <script>
191
        (function () {
191
        (function () {
192
            function getURLParams() {
192
            function getURLParams() {
193
- 

Return to bug 39142