[+] BO : you can now set detailed permissions for each module in the back end
This commit is contained in:
@@ -862,6 +862,14 @@ CREATE TABLE `PREFIX_module` (
|
||||
KEY `name` (`name`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `PREFIX_module_access` (
|
||||
`id_profile` int(10) unsigned NOT NULL,
|
||||
`id_module` int(10) unsigned NOT NULL,
|
||||
`view` tinyint(1) NOT NULL,
|
||||
`configure` tinyint(1) NOT NULL,
|
||||
PRIMARY KEY (`id_profile`,`id_module`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `PREFIX_module_country` (
|
||||
`id_module` int(10) unsigned NOT NULL,
|
||||
`id_shop` INT(11) UNSIGNED NOT NULL DEFAULT '1',
|
||||
|
||||
@@ -59,8 +59,9 @@ INSERT INTO `PREFIX_module` (`id_module`, `name`, `active`) VALUES (1, 'homefeat
|
||||
(47, 'statsbestvouchers', 1),(48, 'statsbestsuppliers', 1),(49, 'statscarrier', 1),(50, 'statsnewsletter', 1),(51, 'statssearch', 1),(52, 'statscheckup', 1),(53, 'statsstock', 1),
|
||||
(54, 'blockstore', 1),(55, 'statsforecast', 1);
|
||||
|
||||
INSERT INTO `PREFIX_module_shop` (`id_module`, `id_shop`) (SELECT `id_module`, 1 FROM `PREFIX_module`);
|
||||
INSERT INTO `PREFIX_module_access` (`id_profile`, `id_module`, `configure`, `view`) (SELECT 1, id_module, 1, 1 FROM PREFIX_module);
|
||||
|
||||
INSERT INTO `PREFIX_module_shop` (`id_module`, `id_shop`) (SELECT `id_module`, 1 FROM `PREFIX_module`);
|
||||
|
||||
INSERT INTO `PREFIX_hook` (`name`, `title`, `description`, `position`) VALUES
|
||||
('myAccountBlock', 'My account block', 'Display extra informations inside the "my account" block', 1);
|
||||
@@ -1107,6 +1108,10 @@ INSERT INTO `PREFIX_access` (`id_profile`, `id_tab`, `view`, `add`, `edit`, `del
|
||||
(4, 91, 0, 0, 0, 0),
|
||||
(4, 92, 0, 0, 0, 0);
|
||||
|
||||
INSERT INTO `PREFIX_module_access` (`id_profile`, `id_module`, `configure`, `view`) (SELECT 2, id_module, 0, 1 FROM PREFIX_module);
|
||||
INSERT INTO `PREFIX_module_access` (`id_profile`, `id_module`, `configure`, `view`) (SELECT 3, id_module, 0, 1 FROM PREFIX_module);
|
||||
INSERT INTO `PREFIX_module_access` (`id_profile`, `id_module`, `configure`, `view`) (SELECT 4, id_module, 0, 1 FROM PREFIX_module);
|
||||
|
||||
INSERT INTO `PREFIX_profile` (`id_profile`) VALUES (2),(3),(4);
|
||||
INSERT INTO `PREFIX_profile_lang` (`id_lang`, `id_profile`, `name`) VALUES
|
||||
(1, 2, 'Logistician'),(2, 2, 'Logisticien'),(3, 2, 'Logistician'),(4, 2, 'Logistiker'),(5, 2, 'Logista'),
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
SET NAMES 'utf8';
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_module_access` (
|
||||
`id_profile` int(10) unsigned NOT NULL,
|
||||
`id_module` int(10) unsigned NOT NULL,
|
||||
`view` tinyint(1) NOT NULL,
|
||||
`configure` tinyint(1) NOT NULL,
|
||||
PRIMARY KEY (`id_profile`,`id_module`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
INSERT INTO `PREFIX_module_access` (`id_profile`, `id_module`, `configure`, `view`) (
|
||||
SELECT id_profile, id_module, 0, 1
|
||||
FROM PREFIX_access a, PREFIX_module m
|
||||
WHERE id_tab = (SELECT `id_tab` FROM PREFIX_tab WHERE class_name = 'AdminModules' LIMIT 1)
|
||||
AND a.`view` = 0
|
||||
);
|
||||
|
||||
INSERT INTO `PREFIX_module_access` (`id_profile`, `id_module`, `configure`, `view`) (
|
||||
SELECT id_profile, id_module, 1, 1
|
||||
FROM PREFIX_access a, PREFIX_module m
|
||||
WHERE id_tab = (SELECT `id_tab` FROM PREFIX_tab WHERE class_name = 'AdminModules' LIMIT 1)
|
||||
AND a.`view` = 1
|
||||
);
|
||||
Reference in New Issue
Block a user