From 0700a8b732ad3cda3ead9bc099ee5113cd84565d Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Sat, 19 Jun 2010 07:53:59 -0400 Subject: [PATCH] bug 4896: granular permissions now always on (DB rev 138) Per the following koha-devel thread, the use of staff user subpermissions, AKA granular permissions, is now the default behavior in Koha. This patch removes the GranularPermissions system preference. [1] http://lists.koha-community.org/pipermail/koha-devel/2010-February/033670.html Signed-off-by: Galen Charlton --- C4/Auth.pm | 55 ++++----- admin/authorised_values.pl | 6 +- admin/systempreferences.pl | 1 - .../data/mysql/de-DE/mandatory/sysprefs.sql | 1 - .../data/mysql/en/mandatory/sysprefs.sql | 1 - .../unimarc_standard_systemprefs.sql | 1 - .../data/mysql/pl-PL/mandatory/sysprefs.sql | 1 - ...ferences_full_optimal_for_install_only.sql | 1 - ..._preferences_only_translation_updating.sql | 2 - ...ferences_full_optimal_for_install_only.sql | 1 - ..._preferences_only_translation_updating.sql | 3 - installer/data/mysql/updatedatabase.pl | 6 + .../en/modules/admin/preferences/admin.pref | 9 +- .../en/modules/help/members/member-flags.tmpl | 21 +--- kohaversion.pl | 2 +- members/member-flags.pl | 106 +++++++++--------- svc/config/systempreferences | 4 +- 17 files changed, 85 insertions(+), 136 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index cb52a6647e..593f36e74d 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -206,24 +206,16 @@ sub get_template_and_user { } } - if (C4::Context->preference('GranularPermissions')) { - if ( $flags ) { - foreach my $module (keys %$all_perms) { - if ( $flags->{$module} == 1) { - foreach my $subperm (keys %{ $all_perms->{$module} }) { - $template->param( "CAN_user_${module}_${subperm}" => 1 ); - } - } elsif ( ref($flags->{$module}) ) { - foreach my $subperm (keys %{ $flags->{$module} } ) { - $template->param( "CAN_user_${module}_${subperm}" => 1 ); - } - } - } - } - } else { + if ( $flags ) { foreach my $module (keys %$all_perms) { - foreach my $subperm (keys %{ $all_perms->{$module} }) { - $template->param( "CAN_user_${module}_${subperm}" => 1 ); + if ( $flags->{$module} == 1) { + foreach my $subperm (keys %{ $all_perms->{$module} }) { + $template->param( "CAN_user_${module}_${subperm}" => 1 ); + } + } elsif ( ref($flags->{$module}) ) { + foreach my $subperm (keys %{ $flags->{$module} } ) { + $template->param( "CAN_user_${module}_${subperm}" => 1 ); + } } } } @@ -504,9 +496,10 @@ that the user must have the "circulate" privilege in order to proceed. To make sure that access control is correct, the C<$flagsrequired> parameter must be specified correctly. -If the GranularPermissions system preference is ON, the -value of each key in the C hash takes on an additional -meaning, e.g., +Koha also has a concept of sub-permissions, also known as +granular permissions. This makes the value of each key +in the C hash take on an additional +meaning, i.e., 1 @@ -1561,20 +1554,16 @@ sub haspermission { } return $flags if $flags->{superlibrarian}; foreach my $module ( keys %$flagsrequired ) { - if (C4::Context->preference('GranularPermissions')) { - my $subperm = $flagsrequired->{$module}; - if ($subperm eq '*') { - return 0 unless ( $flags->{$module} == 1 or ref($flags->{$module}) ); - } else { - return 0 unless ( $flags->{$module} == 1 or - ( ref($flags->{$module}) and - exists $flags->{$module}->{$subperm} and - $flags->{$module}->{$subperm} == 1 - ) - ); - } + my $subperm = $flagsrequired->{$module}; + if ($subperm eq '*') { + return 0 unless ( $flags->{$module} == 1 or ref($flags->{$module}) ); } else { - return 0 unless ( $flags->{$module} ); + return 0 unless ( $flags->{$module} == 1 or + ( ref($flags->{$module}) and + exists $flags->{$module}->{$subperm} and + $flags->{$module}->{$subperm} == 1 + ) + ); } } return $flags; diff --git a/admin/authorised_values.pl b/admin/authorised_values.pl index 32acb5b3ae..de05512195 100755 --- a/admin/authorised_values.pl +++ b/admin/authorised_values.pl @@ -52,14 +52,10 @@ $searchfield =~ s/\,//g; my $script_name = "/cgi-bin/koha/admin/authorised_values.pl"; my $dbh = C4::Context->dbh; -# my $subpermission = C4::Context->preference('GranularPermissions') ? -# { editcatalogue => ... } : -# { parameters => 1 } ; - my ($template, $borrowernumber, $cookie)= get_template_and_user({ template_name => "admin/authorised_values.tmpl", authnotrequired => 0, - flagsrequired => {parameters => 1}, # soon $subpermission + flagsrequired => {parameters => 1}, query => $input, type => "intranet", debug => 1, diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index 6ed5310afa..9e90d617ce 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -97,7 +97,6 @@ $tabsysprefs{DebugLevel} = "Admin"; $tabsysprefs{SessionStorage} = "Admin"; $tabsysprefs{noItemTypeImages} = "Admin"; $tabsysprefs{OPACBaseURL} = "Admin"; -$tabsysprefs{GranularPermissions} = "Admin"; # Authorities $tabsysprefs{authoritysep} = "Authorities"; diff --git a/installer/data/mysql/de-DE/mandatory/sysprefs.sql b/installer/data/mysql/de-DE/mandatory/sysprefs.sql index 276c7cd9b1..2a0be552ae 100644 --- a/installer/data/mysql/de-DE/mandatory/sysprefs.sql +++ b/installer/data/mysql/de-DE/mandatory/sysprefs.sql @@ -184,7 +184,6 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:ConfFile','','If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.',NULL,'File'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACItemHolds','1','Allow OPAC users to place hold on specific items. If OFF, users can only request next available copy.','','YesNo'); -INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('GranularPermissions','0','Use detailed staff user permissions',NULL,'YesNo'); INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALUES ('AddPatronLists','categorycode','categorycode|category_type','Choice','Allow user to choose what list to pick up from when adding patrons'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ExtendedPatronAttributes','0','Use extended patron IDs and attributes',NULL,'YesNo'); diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 7060fa2674..49a02ea459 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -184,7 +184,6 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:ConfFile','','If empty, Koha OAI Server operates in normal mode, otherwise it operates in extended mode.',NULL,'File'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACItemHolds','1','Allow OPAC users to place hold on specific items. If OFF, users can only request next available copy.','','YesNo'); -INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('GranularPermissions','0','Use detailed staff user permissions',NULL,'YesNo'); INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALUES ('AddPatronLists','categorycode','categorycode|category_type','Choice','Allow user to choose what list to pick up from when adding patrons'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ExtendedPatronAttributes','0','Use extended patron IDs and attributes',NULL,'YesNo'); diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql index d6d6dc6f10..76db9c96b3 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql @@ -187,7 +187,6 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('CircControl',"ItemHomeLibrary",'Précise la bibliothèque qui contrôle les règles de prêt et d''amende',"PickupLibrary|PatronLibrary|ItemHomeLibrary",'Choice'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACItemHolds','1','Si activé, les adhérents peuvent placer des réservations sur un exemplaire spécifique. Sinon, il ne peuvent que réserver le prochain disponible.','','YesNo'); -INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('GranularPermissions','0','Utiliser les permissions détaillées',NULL,'YesNo'); INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALUES ('AddPatronLists','categorycode','categorycode|category_type','Choice','Slectionner categorycode ou category_type permet d''afficher la liste des catégories ou des types de catégories à l''ajout d''un lecteur'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ExtendedPatronAttributes','0','Utiliser les attributs étendus pour les adhérents',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('RenewSerialAddsSuggestion','0','Si activé, génère une suggestion d''achat à chaque Renouvellement d''abonnement',NULL,'YesNo'); diff --git a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql index 54f419488a..3707294727 100644 --- a/installer/data/mysql/pl-PL/mandatory/sysprefs.sql +++ b/installer/data/mysql/pl-PL/mandatory/sysprefs.sql @@ -185,7 +185,6 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:Subset','itemtype=\'BOOK\'','Restrict answer to matching raws of the biblioitems table EXPERIMENTAL',NULL,'Free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACItemHolds','1','Allow OPAC users to place hold on specific items. If OFF, users can only request next available copy.','','YesNo'); -INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('GranularPermissions','0','Use detailed staff user permissions',NULL,'YesNo'); INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALUES ('AddPatronLists','categorycode','categorycode|category_type','Choice','Allow user to choose what list to pick up from when adding patrons'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ExtendedPatronAttributes','0','Use extended patron IDs and attributes',NULL,'YesNo'); diff --git a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql index 0f8dd9f5a3..2edbe10eaa 100644 --- a/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql +++ b/installer/data/mysql/ru-RU/mandatory/system_preferences_full_optimal_for_install_only.sql @@ -213,7 +213,6 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:Subset','itemtype=\'BOOK\'','Restrict answer to matching raws of the biblioitems table EXPERIMENTAL',NULL,'Free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACItemHolds','1','Allow OPAC users to place hold on specific items. If OFF, users can only request next available copy.','','YesNo'); -INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('GranularPermissions','0','Use detailed staff user permissions',NULL,'YesNo'); INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALUES ('AddPatronLists','categorycode','categorycode|category_type','Choice','Allow user to choose what list to pick up from when adding patrons'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ExtendedPatronAttributes','1','Use extended patron IDs and attributes',NULL,'YesNo'); diff --git a/installer/data/mysql/ru-RU/mandatory/system_preferences_only_translation_updating.sql b/installer/data/mysql/ru-RU/mandatory/system_preferences_only_translation_updating.sql index dc295d2292..5d9ce1a3c6 100644 --- a/installer/data/mysql/ru-RU/mandatory/system_preferences_only_translation_updating.sql +++ b/installer/data/mysql/ru-RU/mandatory/system_preferences_only_translation_updating.sql @@ -13,8 +13,6 @@ UPDATE systempreferences SET explanation='Символ-разделитель п UPDATE systempreferences SET explanation='Список загруженных структур в веб-инсталляторе' WHERE variable='FrameworksLoaded'; -- Frameworks loaded through webinstaller -UPDATE systempreferences SET explanation='Использование подразделения привилегий для работников' WHERE variable='GranularPermissions'; --- Use detailed staff user permissions UPDATE systempreferences SET explanation='Если включено, то повышает безопасность между библиотеками. Используется, когда библиотеки используют одну инсталляцию Коха.' WHERE variable='IndependantBranches'; -- If ON, increases security between libraries diff --git a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql index e45ad312af..130b46b330 100644 --- a/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql +++ b/installer/data/mysql/uk-UA/mandatory/system_preferences_full_optimal_for_install_only.sql @@ -239,7 +239,6 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OAI-PMH:Subset','itemtype=\'BOOK\'','Restrict answer to matching raws of the biblioitems table EXPERIMENTAL',NULL,'Free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACItemHolds','1','Allow OPAC users to place hold on specific items. If OFF, users can only request next available copy.','','YesNo'); -INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('GranularPermissions','0','Use detailed staff user permissions',NULL,'YesNo'); INSERT INTO `systempreferences` (variable, value,options,type, explanation) VALUES ('AddPatronLists','categorycode','categorycode|category_type','Choice','Allow user to choose what list to pick up from when adding patrons'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('ExtendedPatronAttributes','1','Use extended patron IDs and attributes',NULL,'YesNo'); diff --git a/installer/data/mysql/uk-UA/mandatory/system_preferences_only_translation_updating.sql b/installer/data/mysql/uk-UA/mandatory/system_preferences_only_translation_updating.sql index 5a8bb0d356..0c8c52333e 100644 --- a/installer/data/mysql/uk-UA/mandatory/system_preferences_only_translation_updating.sql +++ b/installer/data/mysql/uk-UA/mandatory/system_preferences_only_translation_updating.sql @@ -13,9 +13,6 @@ UPDATE systempreferences SET explanation='Символ-роздільник по UPDATE systempreferences SET explanation='Перелік завантажених структур у веб-встановлювачі' WHERE variable='FrameworksLoaded'; -- Frameworks loaded through webinstaller -UPDATE systempreferences SET explanation='Використання підрозділення привілеїв для працівників' WHERE variable='GranularPermissions'; --- Use detailed staff user permissions - UPDATE systempreferences SET explanation='Якщо ввімкнуто, то підвищує безпеку між бібліотеками. Використовується, коли бібліотеки використовують одну інсталяцію Коха.' WHERE variable='IndependantBranches'; -- If ON, increases security between libraries diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index b65bdd1a60..7ea266eca5 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -3642,6 +3642,12 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { } +$DBversion = "3.01.00.138"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("DELETE FROM systempreferences WHERE variable = 'GranularPermissions'"); + print "Upgrade to $DBversion done (bug 4896: removing GranularPermissions syspref; use of granular permissions is now the default)"; + SetVersion ($DBversion); +} =item DropAllForeignKeys($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref index 069ea9df99..2dbd086dfb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref @@ -70,13 +70,6 @@ Administration: mysql: in the MySQL database. Pg: in the PostgreSQL database (not supported). tmp: as temporary files. - - - - Control staff access to pages within Koha based on - - pref: GranularPermissions - default: 0 - choices: - yes: the specific page. - no: the general module (such as administration or circulation). - - pref: IndependantBranches default: 0 @@ -101,4 +94,4 @@ Administration: - of CAS when logging out of Koha. - - The CAS Authentication Server can be found at - - pref: casServerUrl \ No newline at end of file + - pref: casServerUrl diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/member-flags.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/member-flags.tmpl index 6caa51762b..f0d744e104 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/member-flags.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/help/members/member-flags.tmpl @@ -13,17 +13,6 @@ TIP: If a staff member is set to 'superlibrarian' they have access to all functions and do not need any other permissions checked -
  • To give staff members more granular permissions, you can turn on the GranularPermissions system preference -
      -
    • Get there: More > Administration > General preferences > Admin > GranularPermissions
    • -
    • If this setting is on the permissions menu will offer more granual permissions
    • -
    • This allows staff members access to specific tools -
        -
      • - -TIP: If this preference is turned OFF after being ON, the system reverts to the original behavior, although the specific permissions are retained.  This means if a staff member has been given granular permissions they will retain those even if this is turned OFF
      • -
    • -
  • What will each permission level do?

    @@ -37,10 +26,6 @@ TIP: If this preference is turned OFF after being ON, the system reverts to the
  • circulate
    • Ability for logged in user to check books out and back in
    • -
    • With GranularPermissions on this section will be expanded to allow access to specific ciculation functions. -
        -
      • Get there: More > Administration > Global System Preferences > Admin > GranularPermissions
      • -
  • catalog
      @@ -86,10 +71,6 @@ TIP: If this preference is turned OFF after being ON, the system reverts to the
    • tools
      • Use tools (export, import, barcodes)
      • -
      • With GranularPermissions on this section will be expanded to allow access only to specific tools -
          -
        • Get there: More > Administration > Global System Preferences > Admin > GranularPermissions
        • -
    • editauthorities
        @@ -107,4 +88,4 @@ TIP: If this preference is turned OFF after being ON, the system reverts to the
        • Provides the ability to modify login / permissions for staff users
        -
      \ No newline at end of file +
    diff --git a/kohaversion.pl b/kohaversion.pl index e7972f864d..8da986bbfc 100644 --- a/kohaversion.pl +++ b/kohaversion.pl @@ -10,7 +10,7 @@ use strict; sub kohaversion { - our $VERSION = '3.01.00.137'; + our $VERSION = '3.01.00.138'; # version needs to be set this way # so that it can be picked up by Makefile.PL # during install diff --git a/members/member-flags.pl b/members/member-flags.pl index 749ceccb34..321e5260fb 100755 --- a/members/member-flags.pl +++ b/members/member-flags.pl @@ -66,19 +66,17 @@ if ($input->param('newflags')) { $sth = $dbh->prepare("UPDATE borrowers SET flags=? WHERE borrowernumber=?"); $sth->execute($module_flags, $member); - if (C4::Context->preference('GranularPermissions')) { - # deal with subpermissions - $sth = $dbh->prepare("DELETE FROM user_permissions WHERE borrowernumber = ?"); - $sth->execute($member); - $sth = $dbh->prepare("INSERT INTO user_permissions (borrowernumber, module_bit, code) - SELECT ?, bit, ? - FROM userflags - WHERE flag = ?"); - foreach my $module (keys %sub_perms) { - next if exists $all_module_perms{$module}; - foreach my $sub_perm (@{ $sub_perms{$module} }) { - $sth->execute($member, $sub_perm, $module); - } + # deal with subpermissions + $sth = $dbh->prepare("DELETE FROM user_permissions WHERE borrowernumber = ?"); + $sth->execute($member); + $sth = $dbh->prepare("INSERT INTO user_permissions (borrowernumber, module_bit, code) + SELECT ?, bit, ? + FROM userflags + WHERE flag = ?"); + foreach my $module (keys %sub_perms) { + next if exists $all_module_perms{$module}; + foreach my $sub_perm (@{ $sub_perms{$module} }) { + $sth->execute($member, $sub_perm, $module); } } @@ -104,53 +102,51 @@ if ($input->param('newflags')) { checked => $checked, flagdesc => $flagdesc ); - if (C4::Context->preference('GranularPermissions')) { - my @sub_perm_loop = (); - my $expand_parent = 0; - if ($checked) { - if (exists $all_perms->{$flag}) { - $expand_parent = 1; - foreach my $sub_perm (sort keys %{ $all_perms->{$flag} }) { - push @sub_perm_loop, { - id => "${flag}_$sub_perm", - perm => "$flag:$sub_perm", - code => $sub_perm, - description => $all_perms->{$flag}->{$sub_perm}, - checked => 1 - }; - } + my @sub_perm_loop = (); + my $expand_parent = 0; + if ($checked) { + if (exists $all_perms->{$flag}) { + $expand_parent = 1; + foreach my $sub_perm (sort keys %{ $all_perms->{$flag} }) { + push @sub_perm_loop, { + id => "${flag}_$sub_perm", + perm => "$flag:$sub_perm", + code => $sub_perm, + description => $all_perms->{$flag}->{$sub_perm}, + checked => 1 + }; } - } else { - if (exists $user_perms->{$flag}) { - $expand_parent = 1; - # put selected ones first - foreach my $sub_perm (sort keys %{ $user_perms->{$flag} }) { - push @sub_perm_loop, { - id => "${flag}_$sub_perm", - perm => "$flag:$sub_perm", - code => $sub_perm, - description => $all_perms->{$flag}->{$sub_perm}, - checked => 1 - }; - } + } + } else { + if (exists $user_perms->{$flag}) { + $expand_parent = 1; + # put selected ones first + foreach my $sub_perm (sort keys %{ $user_perms->{$flag} }) { + push @sub_perm_loop, { + id => "${flag}_$sub_perm", + perm => "$flag:$sub_perm", + code => $sub_perm, + description => $all_perms->{$flag}->{$sub_perm}, + checked => 1 + }; } - # then ones not selected - if (exists $all_perms->{$flag}) { - foreach my $sub_perm (sort keys %{ $all_perms->{$flag} }) { - push @sub_perm_loop, { - id => "${flag}_$sub_perm", - perm => "$flag:$sub_perm", - code => $sub_perm, - description => $all_perms->{$flag}->{$sub_perm}, - checked => 0 - } unless exists $user_perms->{$flag} and exists $user_perms->{$flag}->{$sub_perm}; - } + } + # then ones not selected + if (exists $all_perms->{$flag}) { + foreach my $sub_perm (sort keys %{ $all_perms->{$flag} }) { + push @sub_perm_loop, { + id => "${flag}_$sub_perm", + perm => "$flag:$sub_perm", + code => $sub_perm, + description => $all_perms->{$flag}->{$sub_perm}, + checked => 0 + } unless exists $user_perms->{$flag} and exists $user_perms->{$flag}->{$sub_perm}; } } - $row{expand} = $expand_parent; - if ($#sub_perm_loop > -1) { + } + $row{expand} = $expand_parent; + if ($#sub_perm_loop > -1) { $row{sub_perm_loop} = \@sub_perm_loop; - } } push @loop, \%row; } diff --git a/svc/config/systempreferences b/svc/config/systempreferences index 6fe714a706..8622f6a5a8 100755 --- a/svc/config/systempreferences +++ b/svc/config/systempreferences @@ -83,9 +83,9 @@ pref_$pref1=$value1&pref_$pref2=$value2 Used to set several system preferences at once. Each preference you want to set should be sent prefixed with pref. If you wanted to turn off the -GranularPermissions syspref, for instance, you would POST the following: +virtualshelves syspref, for instance, you would POST the following: -pref_GranularPermissions=0 +pref_virtualshelves=0 =cut -- 2.39.5