- if ( $flags && $flags->{circulate} == 1 ) {
- $template->param( CAN_user_circulate => 1 );
- }
-
- if ( $flags && $flags->{catalogue} == 1 ) {
- $template->param( CAN_user_catalogue => 1 );
- }
-
- if ( $flags && $flags->{parameters} == 1 ) {
- $template->param( CAN_user_parameters => 1 );
- $template->param( CAN_user_management => 1 );
- }
-
- if ( $flags && $flags->{borrowers} == 1 ) {
- $template->param( CAN_user_borrowers => 1 );
- }
-
- if ( $flags && $flags->{permissions} == 1 ) {
- $template->param( CAN_user_permission => 1 );
- }
-
- if ( $flags && $flags->{reserveforothers} == 1 ) {
- $template->param( CAN_user_reserveforothers => 1 );
- }
-
- if ( $flags && $flags->{borrow} == 1 ) {
- $template->param( CAN_user_borrow => 1 );
- }
-
- if ( $flags && $flags->{editcatalogue} == 1 ) {
- $template->param( CAN_user_editcatalogue => 1 );
- }
-
- if ( $flags && $flags->{updatecharges} == 1 ) {
- $template->param( CAN_user_updatecharge => 1 );
- }
-
- if ( $flags && $flags->{acquisition} == 1 ) {
- $template->param( CAN_user_acquisition => 1 );
- }
-
- if ( $flags && $flags->{tools} == 1 ) {
- $template->param( CAN_user_tools => 1 );
- }
-
- if ( $flags && $flags->{editauthorities} == 1 ) {
- $template->param( CAN_user_editauthorities => 1 );
- }
-
- if ( $flags && $flags->{serials} == 1 ) {
- $template->param( CAN_user_serials => 1 );
- }
-
- if ( $flags && $flags->{reports} == 1 ) {
- $template->param( CAN_user_reports => 1 );
- }
+ if ($flags) {
+ ($flags->{parameters} == 1) and $template->param(CAN_user_management => 1);
+ foreach (@params) {
+ ($flags->{$_} == 1) and $template->param('CAN_user_' . $_ => 1);
+ }
+ # terrible non-conformant param names ("s" gets dropped from the end!?)
+ ($flags->{permissions} == 1) and $template->param(CAN_user_permission => 1);
+ ($flags->{updatechanges} == 1) and $template->param(CAN_user_updatechange => 1);
+ }