INSERT INTO `module` (`module_id`, `is_configurable`, `name`, `title`, `description`, `admin_uri`, `icon`, `maintainers`, `version`, `license`, `state`) VALUES ({SGL_NEXT_ID}, 1, 'articleweb', 'Article', 'Generated by ModuleGenerationMgr', '', '48/module_default.png', 'Alouicious Bird', NULL, 'NULL', 'NULL');

SELECT @moduleId := MAX(module_id) FROM module;

#AdminArticleWebMgr
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminarticlewebmgr', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminarticlewebmgr_cmd_view', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminarticlewebmgr_cmd_addview', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminarticlewebmgr_cmd_add', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminarticlewebmgr_cmd_editview', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminarticlewebmgr_cmd_edit', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminarticlewebmgr_cmd_delete', '', @moduleId);

#AdminArticleWebTypeMgr
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminarticletypewebmgr', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminarticletypewebmgr_cmd_view', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminarticletypewebmgr_cmd_addview', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminarticletypewebmgr_cmd_add', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminarticletypewebmgr_cmd_editview', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminarticletypewebmgr_cmd_edit', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'adminarticletypewebmgr_cmd_delete', '', @moduleId);

#ArticleViewWebMgr
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'articleviewwebmgr', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'articleviewwebmgr_cmd_viewarticle', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'articleviewwebmgr_cmd_viewarticletype', '', @moduleId);
INSERT INTO permission VALUES ({SGL_NEXT_ID}, 'articleviewwebmgr_cmd_viewarticlealltype', '', @moduleId);

#member role perms