$tabsysprefs{SessionStorage}="Admin";
$tabsysprefs{noItemTypeImages}="Admin";
$tabsysprefs{OPACBaseURL}="Admin";
+ $tabsysprefs{CheckSpecificUserPermissions}="Admin";
# Authorities
$tabsysprefs{authoritysep}="Authorities";
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('CheckSpecificUserPermissions','0','Check most specific staff user permissions',NULL,'YesNo');
--- /dev/null
+INSERT INTO permissions (module_bit, code, description) VALUES
+ (13, 'edit_news', 'Write news for the OPAC and staff interfaces'),
+ (13, 'label_creator', 'Create printable labels and barcodes from catalog and patron data'),
+ (13, 'edit_calendar', 'Define days when the library is closed'),
+ (13, 'moderate_comments', 'Moderate patron comments'),
+ (13, 'edit_notices', 'Define notices'),
+ (13, 'edit_notice_status_triggers', 'Set notice/status triggers for overdue items'),
+ (13, 'view_system_logs', 'Browse the system logs'),
+ (13, 'inventory', 'Perform inventory (stocktaking) of your catalogue'),
+ (13, 'stage_marc_import', 'Stage MARC records into the reservoir'),
+ (13, 'manage_staged_marc', 'Managed staged MARC records, including completing and reversing imports'),
+ (13, 'export_catalog', 'Export bibliographic and holdings data'),
+ (13, 'import_patrons', 'Import patron data'),
+ (13, 'delete_anonymize_patrons', 'Delete old borrowers and anonymize circulation history (deletes borrower reading history)'),
+ (13, 'batch_upload_patron_images', 'Upload patron images in batch or one at a time'),
+ (13, 'schedule_tasks', 'Schedule tasks to run')
+;
--- /dev/null
+Detailed staff user permissions
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('CheckSpecificUserPermissions','0','Check most specific staff user permissions',NULL,'YesNo');
--- /dev/null
+INSERT INTO permissions (module_bit, code, description) VALUES
+ (13, 'edit_news', 'Write news for the OPAC and staff interfaces'),
+ (13, 'label_creator', 'Create printable labels and barcodes from catalog and patron data'),
+ (13, 'edit_calendar', 'Define days when the library is closed'),
+ (13, 'moderate_comments', 'Moderate patron comments'),
+ (13, 'edit_notices', 'Define notices'),
+ (13, 'edit_notice_status_triggers', 'Set notice/status triggers for overdue items'),
+ (13, 'view_system_logs', 'Browse the system logs'),
+ (13, 'inventory', 'Perform inventory (stocktaking) of your catalogue'),
+ (13, 'stage_marc_import', 'Stage MARC records into the reservoir'),
+ (13, 'manage_staged_marc', 'Managed staged MARC records, including completing and reversing imports'),
+ (13, 'export_catalog', 'Export bibliographic and holdings data'),
+ (13, 'import_patrons', 'Import patron data'),
+ (13, 'delete_anonymize_patrons', 'Delete old borrowers and anonymize circulation history (deletes borrower reading history)'),
+ (13, 'batch_upload_patron_images', 'Upload patron images in batch or one at a time'),
+ (13, 'schedule_tasks', 'Schedule tasks to run')
+;
--- /dev/null
+Detailed staff user permissions
KEY `language_subtag` (`language_subtag`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+DROP TABLE IF EXISTS `permissions`;
+CREATE TABLE `permissions` (
+ `module_bit` int(11) NOT NULL DEFAULT 0,
+ `code` varchar(30) DEFAULT NULL,
+ `description` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`module_bit`, `code`),
+ CONSTRAINT `permissions_ibfk_1` FOREIGN KEY (`module_bit`) REFERENCES `userflags` (`bit`)
+ ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
DROP TABLE IF EXISTS serialitems;
CREATE TABLE serialitems (
serialid int(11) NOT NULL,
UNIQUE KEY `serialididx` (`serialid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+DROP TABLE IF EXISTS `user_permissions`;
+CREATE TABLE `user_permissions` (
+ `borrowernumber` int(11) NOT NULL DEFAULT 0,
+ `module_bit` int(11) NOT NULL DEFAULT 0,
+ `code` varchar(30) DEFAULT NULL,
+ CONSTRAINT `user_permissions_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`)
+ ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `user_permissions_ibfk_2` FOREIGN KEY (`module_bit`, `code`) REFERENCES `permissions` (`module_bit`, `code`)
+ ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
SetVersion ($DBversion);
}
+$DBversion = "3.00.00.068";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+ $dbh->do("CREATE TABLE `permissions` (
+ `module_bit` int(11) NOT NULL DEFAULT 0,
+ `code` varchar(30) DEFAULT NULL,
+ `description` varchar(255) DEFAULT NULL,
+ PRIMARY KEY (`module_bit`, `code`),
+ CONSTRAINT `permissions_ibfk_1` FOREIGN KEY (`module_bit`) REFERENCES `userflags` (`bit`)
+ ON DELETE CASCADE ON UPDATE CASCADE
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8");
+ $dbh->do("CREATE TABLE `user_permissions` (
+ `borrowernumber` int(11) NOT NULL DEFAULT 0,
+ `module_bit` int(11) NOT NULL DEFAULT 0,
+ `code` varchar(30) DEFAULT NULL,
+ CONSTRAINT `user_permissions_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`)
+ ON DELETE CASCADE ON UPDATE CASCADE,
+ CONSTRAINT `user_permissions_ibfk_2` FOREIGN KEY (`module_bit`, `code`)
+ REFERENCES `permissions` (`module_bit`, `code`)
+ ON DELETE CASCADE ON UPDATE CASCADE
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8");
+
+ $dbh->do("INSERT INTO permissions (module_bit, code, description) VALUES
+ (13, 'edit_news', 'Write news for the OPAC and staff interfaces'),
+ (13, 'label_creator', 'Create printable labels and barcodes from catalog and patron data'),
+ (13, 'edit_calendar', 'Define days when the library is closed'),
+ (13, 'moderate_comments', 'Moderate patron comments'),
+ (13, 'edit_notices', 'Define notices'),
+ (13, 'edit_notice_status_triggers', 'Set notice/status triggers for overdue items'),
+ (13, 'view_system_logs', 'Browse the system logs'),
+ (13, 'inventory', 'Perform inventory (stocktaking) of your catalogue'),
+ (13, 'stage_marc_import', 'Stage MARC records into the reservoir'),
+ (13, 'manage_staged_marc', 'Managed staged MARC records, including completing and reversing imports'),
+ (13, 'export_catalog', 'Export bibliographic and holdings data'),
+ (13, 'import_patrons', 'Import patron data'),
+ (13, 'delete_anonymize_patrons', 'Delete old borrowers and anonymize circulation history (deletes borrower reading history)'),
+ (13, 'batch_upload_patron_images', 'Upload patron images in batch or one at a time'),
+ (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')");
+
+ print "Upgrade to $DBversion done (adding permissions and user_permissions tables and CheckSpecificUserPermissions syspref) ";
+ SetVersion ($DBversion);
+}
+
=item DropAllForeignKeys($table)
Drop all foreign keys of the table $table
use strict;
sub kohaversion {
- our $VERSION = "3.00.00.067";
+ our $VERSION = "3.00.00.068";
# version needs to be set this way
# so that it can be picked up by Makefile.PL
# during install