renamed CheckSpecificUserPermissions to GranularPermissions
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
parent
7a2a241fa3
commit
83f8e22aec
6 changed files with 10 additions and 10 deletions
|
@ -191,7 +191,7 @@ sub get_template_and_user {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (C4::Context->preference('CheckSpecificUserPermissions')) {
|
if (C4::Context->preference('GranularPermissions')) {
|
||||||
if ( $flags ) {
|
if ( $flags ) {
|
||||||
foreach my $module (keys %$all_perms) {
|
foreach my $module (keys %$all_perms) {
|
||||||
if ( $flags->{$module} == 1) {
|
if ( $flags->{$module} == 1) {
|
||||||
|
@ -357,7 +357,7 @@ that the user must have the "circulate" privilege in order to
|
||||||
proceed. To make sure that access control is correct, the
|
proceed. To make sure that access control is correct, the
|
||||||
C<$flagsrequired> parameter must be specified correctly.
|
C<$flagsrequired> parameter must be specified correctly.
|
||||||
|
|
||||||
If the CheckSpecificUserPermissions system preference is ON, the
|
If the GranularPermissions system preference is ON, the
|
||||||
value of each key in the C<flagsrequired> hash takes on an additional
|
value of each key in the C<flagsrequired> hash takes on an additional
|
||||||
meaning, e.g.,
|
meaning, e.g.,
|
||||||
|
|
||||||
|
@ -1335,7 +1335,7 @@ sub haspermission {
|
||||||
}
|
}
|
||||||
return $flags if $flags->{superlibrarian};
|
return $flags if $flags->{superlibrarian};
|
||||||
foreach my $module ( keys %$flagsrequired ) {
|
foreach my $module ( keys %$flagsrequired ) {
|
||||||
if (C4::Context->preference('CheckSpecificUserPermissions')) {
|
if (C4::Context->preference('GranularPermissions')) {
|
||||||
my $subperm = $flagsrequired->{$module};
|
my $subperm = $flagsrequired->{$module};
|
||||||
if ($subperm eq '*') {
|
if ($subperm eq '*') {
|
||||||
return 0 unless ( $flags->{$module} == 1 or ref($flags->{$module}) );
|
return 0 unless ( $flags->{$module} == 1 or ref($flags->{$module}) );
|
||||||
|
|
|
@ -82,7 +82,7 @@ my %tabsysprefs;
|
||||||
$tabsysprefs{SessionStorage}="Admin";
|
$tabsysprefs{SessionStorage}="Admin";
|
||||||
$tabsysprefs{noItemTypeImages}="Admin";
|
$tabsysprefs{noItemTypeImages}="Admin";
|
||||||
$tabsysprefs{OPACBaseURL}="Admin";
|
$tabsysprefs{OPACBaseURL}="Admin";
|
||||||
$tabsysprefs{CheckSpecificUserPermissions}="Admin";
|
$tabsysprefs{GranularPermissions}="Admin";
|
||||||
|
|
||||||
# Authorities
|
# Authorities
|
||||||
$tabsysprefs{authoritysep}="Authorities";
|
$tabsysprefs{authoritysep}="Authorities";
|
||||||
|
|
|
@ -182,4 +182,4 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
|
||||||
|
|
||||||
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('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('CheckSpecificUserPermissions','0','Check most specific staff user permissions',NULL,'YesNo');
|
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('GranularPermissions','0','Use detailed staff user permissions',NULL,'YesNo');
|
||||||
|
|
|
@ -183,4 +183,4 @@ 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('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('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('CheckSpecificUserPermissions','0','Check most specific staff user permissions',NULL,'YesNo');
|
INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('GranularPermissions','0','Use detailed staff user permissions',NULL,'YesNo');
|
||||||
|
|
|
@ -1268,9 +1268,9 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
|
||||||
(13, 'batch_upload_patron_images', 'Upload patron images in batch or one at a time'),
|
(13, 'batch_upload_patron_images', 'Upload patron images in batch or one at a time'),
|
||||||
(13, 'schedule_tasks', 'Schedule tasks to run')");
|
(13, 'schedule_tasks', 'Schedule tasks to run')");
|
||||||
|
|
||||||
$dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('CheckSpecificUserPermissions','0','Check most specific staff user permissions',NULL,'YesNo')");
|
$dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('GranularPermissions','0','Use detailed staff user permissions',NULL,'YesNo')");
|
||||||
|
|
||||||
print "Upgrade to $DBversion done (adding permissions and user_permissions tables and CheckSpecificUserPermissions syspref) ";
|
print "Upgrade to $DBversion done (adding permissions and user_permissions tables and GranularPermissions syspref) ";
|
||||||
SetVersion ($DBversion);
|
SetVersion ($DBversion);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -64,7 +64,7 @@ if ($input->param('newflags')) {
|
||||||
$sth = $dbh->prepare("UPDATE borrowers SET flags=? WHERE borrowernumber=?");
|
$sth = $dbh->prepare("UPDATE borrowers SET flags=? WHERE borrowernumber=?");
|
||||||
$sth->execute($module_flags, $member);
|
$sth->execute($module_flags, $member);
|
||||||
|
|
||||||
if (C4::Context->preference('CheckSpecificUserPermissions')) {
|
if (C4::Context->preference('GranularPermissions')) {
|
||||||
# deal with subpermissions
|
# deal with subpermissions
|
||||||
$sth = $dbh->prepare("DELETE FROM user_permissions WHERE borrowernumber = ?");
|
$sth = $dbh->prepare("DELETE FROM user_permissions WHERE borrowernumber = ?");
|
||||||
$sth->execute($member);
|
$sth->execute($member);
|
||||||
|
@ -102,7 +102,7 @@ if ($input->param('newflags')) {
|
||||||
checked => $checked,
|
checked => $checked,
|
||||||
flagdesc => $flagdesc );
|
flagdesc => $flagdesc );
|
||||||
|
|
||||||
if (C4::Context->preference('CheckSpecificUserPermissions')) {
|
if (C4::Context->preference('GranularPermissions')) {
|
||||||
my @sub_perm_loop = ();
|
my @sub_perm_loop = ();
|
||||||
my $expand_parent = 0;
|
my $expand_parent = 0;
|
||||||
if ($checked) {
|
if ($checked) {
|
||||||
|
|
Loading…
Reference in a new issue