[Koha-bugs] [Bug 15774] Additional fields for baskets

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Dec 21 12:52:05 CET 2018


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15774

--- Comment #114 from Nick Clemens <nick at bywatersolutions.com> ---
(In reply to Katrin Fischer from comment #96)
> I like the approach of the new permission depending on order_manage and
> edit_subscription
Excellent!

> 1) You need to update installer/data/mysql/userpermissions.sql so the
> permission is installed for new installations.
Done!

> ::: admin/additional-fields.pl
> @@ +33,5 @@
> > +my $op = $input->param('op') // ( $tablename ? 'list' : 'list_tables' );
> > +
> > +if( $op ne 'list_tables' ){
> > +    $flagsrequired{acquisition} = 'order_manage' if $tablename eq 'aqbasket';
> > +    $flagsrequired{serials} = 'edit_subscription' if $tablename eq 'subscription';
> 
> 2) I think you'd want to change this to use the new permission now.
I do set it in the lines above - the main permission gets you to the page, you
need the others to access the individual modules

> 
> :::
> installer/data/mysql/atomicupdate/
> Bug_15774_add_additional_fields_permissions.perl
> @@ +6,5 @@
> > +        (3,'manage_additional_fields','Add, edit, or delete additional custom fields for baskets or subscriptions (also requires order_manage or edit_subscription permissions)')
> > +    });
> > +    $dbh->do( q{
> > +        INSERT INTO user_permissions (borrowernumber, module_bit, code)
> > +        SELECT borrowernumber, 3, 'manage_additional_fields' FROM borrowers WHERE borrowernumber IN (SELECT DISTINCT borrowernumber FROM user_permissions WHERE code = 'order_manage' OR code = 'edit_subscription');
> 
> 3) This will work for everyone who has not full Serials permission. If the
> top level "Serials" permission is checked, the granular ones are not in
> user_permissions. You also need to check for those using the bit operation.
Updated

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list