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

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Dec 20 11:47:57 CET 2018


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

--- Comment #96 from Katrin Fischer <katrin.fischer at bsz-bw.de> ---
Comment on attachment 83364
  --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=83364
Bug 15774: Add permission for managing additional fields

Review of attachment 83364:
 --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=15774&attachment=83364)
-----------------------------------------------------------------

Hi Nick,

I like he approach of the new permission depending on order_manage and
edit_subscription, but I think it's not quite ready yet. Trying to comment with
Splinter.

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

::: 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.

:::
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.

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


More information about the Koha-bugs mailing list