Bug 7651: Add a new permission for managing currencies and exchange rates
At the moment staff users need parameters or parameters_remaining_permissions
in order to be able to change exchange rates for acquisition orders.
This patch adds a new separate permission currencies_manage and
updates staff users currently having those permissions to get the
new permission as well.
To test:
- Create some staff users with different permission sets
1) superlibrarian
2) parameters
3) parameters_remaining_permissions
4) manage_circ_rules, but not parmeters_remaining_permissions
5) all acquisition permissions
- Apply patch and run database update
- Verify new permission has been added and staff users updated
1) remains the same
2) + 3) will have currencies_manage
4) remains unchanged, doesn't have new permission
5) remains the same, will have access now because of having
the top level acquisition permission
- Verify the changed pages work correctly:
- navigation on admin home page
NOTE: the acquisition parameters section will now honor all
different related permissions (edi_manage, budget_manage,...)
- navigation on acquisition home page
- try to access currencies page directly
Signed-off-by: Charles Farmer <charles.farmer@inLibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
parent
583d1c69c6
commit
ff83c7acdc
|
|
@ -40,7 +40,7 @@ our ( $template, $loggedinuser, $cookie ) = get_template_and_user(
|
|||
query => $input,
|
||||
type => 'intranet',
|
||||
authnotrequired => 0,
|
||||
flagsrequired => { parameters => 'parameters_remaining_permissions' },
|
||||
flagsrequired => { acquisition => 'currencies_manage' },
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
INSERT INTO permissions (module_bit, code, description) VALUES (11, 'currencies_manage', 'Manage currencies and exchange rates');
|
||||
|
||||
INSERT INTO user_permissions (borrowernumber, module_bit, code)
|
||||
SELECT borrowernumber, 11, 'currencies_manage' FROM borrowers WHERE flags & (1 << 3) OR borrowernumber IN
|
||||
(SELECT borrowernumber FROM user_permissions WHERE code = 'parameters_remaining_permissions');
|
||||
|
||||
-- Bug 7651: Add new permission currencies_manage and update staff users
|
||||
|
|
@ -17,6 +17,7 @@ INSERT INTO permissions (module_bit, code, description) VALUES
|
|||
( 9, 'delete_all_items', 'Delete all items at once'),
|
||||
(10, 'writeoff', 'Write off fines and fees'),
|
||||
(10, 'remaining_permissions', 'Remaining permissions for managing fines and fees'),
|
||||
(11, 'currencies_manage', 'Manage currencies and exchange rates'),
|
||||
(11, 'vendors_manage', 'Manage vendors'),
|
||||
(11, 'contracts_manage', 'Manage contracts'),
|
||||
(11, 'period_manage', 'Manage budgets'),
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
<li><a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a></li>
|
||||
<li><a href="/cgi-bin/koha/admin/aqbudgets.pl">Funds</a></li>
|
||||
[% END %]
|
||||
[% IF ( CAN_user_parameters ) %]
|
||||
[% IF ( CAN_user_acquisition_currencies_manage ) %]
|
||||
<li><a href="/cgi-bin/koha/admin/currency.pl">Currencies</a></li>
|
||||
[% END %]
|
||||
[% IF CAN_user_acquisition_edi_manage %]
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@
|
|||
[%- CASE 'period_manage' -%]<span>Manage budgets</span>
|
||||
[%- CASE 'planning_manage' -%]<span>Manage budget plannings</span>
|
||||
[%- CASE 'vendors_manage' -%]<span>Manage vendors</span>
|
||||
[%- CASE 'currencies_manage' -%]<span>Manage currencies and exchange rates</span>
|
||||
[%- CASE 'batch_upload_patron_images' -%]<span>Upload patron images in a batch or one at a time</span>
|
||||
[%- CASE 'delete_anonymize_patrons' -%]<span>Delete old borrowers and anonymize circulation history (deletes borrower reading history)</span>
|
||||
[%- CASE 'edit_calendar' -%]<span>Define days when the library is closed</span>
|
||||
|
|
|
|||
|
|
@ -95,22 +95,30 @@
|
|||
[% END %]
|
||||
</dl>
|
||||
|
||||
[% IF ( CAN_user_acquisition_currencies_manage || CAN_user_acquisition_period_manage
|
||||
|| CAN_user_acquisition_budget_manage || CAN_user_acquisition_edi_manage ) %]
|
||||
<h3>Acquisition parameters</h3>
|
||||
<dl>
|
||||
[% IF ( CAN_user_acquisition_currencies_manage ) %]
|
||||
<dt><a href="/cgi-bin/koha/admin/currency.pl">Currencies and exchange rates</a></dt>
|
||||
<dd>Define currencies and exchange rates used for acquisitions.</dd>
|
||||
|
||||
[% END %]
|
||||
[% IF ( CAN_user_acquisition_period_manage ) %]
|
||||
<dt><a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a></dt>
|
||||
<dd>Define your budgets</dd>
|
||||
|
||||
[% END %]
|
||||
[% IF ( CAN_user_acquisition_budget_manage ) %]
|
||||
<dt><a href="/cgi-bin/koha/admin/aqbudgets.pl">Funds</a></dt>
|
||||
<dd>Define funds within your budgets</dd>
|
||||
|
||||
[% END %]
|
||||
[% IF ( CAN_user_acquisition_edi_manage ) %]
|
||||
<dt><a href="/cgi-bin/koha/admin/edi_accounts.pl">EDI accounts</a></dt>
|
||||
<dd>Manage vendor EDI accounts for import/export</dd>
|
||||
<dt><a href="/cgi-bin/koha/admin/edi_ean_accounts.pl">Library EANs</a></dt>
|
||||
<dd>Manage library EDI EANs</dd>
|
||||
[% END %]
|
||||
</dl>
|
||||
[% END %]
|
||||
|
||||
<h3>Additional parameters</h3>
|
||||
<dl>
|
||||
|
|
|
|||
Loading…
Reference in New Issue