/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Stories
 * @copyright  Copyright 2006-2026 Ahead WebSoft Technologies
 * @license    https://socialengine.com/eula
 * @version    $Id: my.sql 2026-01-20 00:00:00Z 
 * @author     SocialEngine
 */


INSERT IGNORE INTO `engine4_core_menuitems` (`name`, `module`, `label`, `plugin`, `params`, `menu`, `submenu`, `order`) VALUES
("core_admin_main_stories", "stories", "Stories", "", '{"route":"admin_default","module":"stories","controller":"settings"}', "core_admin_main_plugins", "", 800),
("stories_admin_main_settings", "stories", "Global Settings", "", '{"route":"admin_default","module":"stories","controller":"settings"}', "stories_admin_main", "", 1);

INSERT IGNORE INTO `engine4_authorization_permissions`
  SELECT
  level_id as `level_id`,
  "stories_story" as `type`,
  "view" as `name`,
  5 as `value`,
  '["registered","owner_network","owner_member","owner"]' as `params`
FROM `engine4_authorization_levels` WHERE `type` NOT IN("public");

INSERT IGNORE INTO `engine4_authorization_permissions`
  SELECT
  level_id as `level_id`,
  "stories_story" as `type`,
  "comment" as `name`,
  5 as `value`,
  '["registered","owner_network","owner_member","owner"]' as `params`
FROM `engine4_authorization_levels` WHERE `type` NOT IN("public");

INSERT IGNORE INTO `engine4_authorization_permissions`
  SELECT
  level_id as `level_id`,
  "user" as `type`,
  "story_view" as `name`,
  5 as `value`,
  '["registered","owner_network","owner_member","owner"]' as `params`
FROM `engine4_authorization_levels` WHERE `type` NOT IN("public");

INSERT IGNORE INTO `engine4_authorization_permissions`
	SELECT
	level_id as `level_id`,
	"user" as `type`,
	"story_comment" as `name`,
	5 as `value`,
	'["registered","owner_network","owner_member","owner"]' as `params`
FROM `engine4_authorization_levels` WHERE `type` NOT IN("public");


