diff --git a/app/Models/MagicApps.php b/app/Models/MagicApps.php new file mode 100644 index 0000000..6497177 --- /dev/null +++ b/app/Models/MagicApps.php @@ -0,0 +1,19 @@ +hasMany(AppRoles::class, 'app_id', 'id') + ->orderBy('role_priority', 'asc'); + } +} diff --git a/database/tables_for_magic2.0/magic_apps.sql b/database/tables_for_magic2.0/magic_apps.sql new file mode 100644 index 0000000..af435d4 --- /dev/null +++ b/database/tables_for_magic2.0/magic_apps.sql @@ -0,0 +1,13 @@ +-- custom.magic_apps definition + +CREATE TABLE `magic_apps` ( + `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT, + `app_name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Имя приложения', + `app_title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Название приложения на русском', + `app_link` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL, + `role_driver` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Драйвер определения ролей: по группам AD, по почтовым рассылкам, по логинам. NULL, если ролевая модель не предусмотрена', + `access_groups_email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Доступ к приложениям по почтовым рассылкам', + `access_groups_ad` text COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Доступ к приложениям по группам AD', + `is_active` tinyint(4) NOT NULL DEFAULT 1 COMMENT 'Активно ли приложение', + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; \ No newline at end of file diff --git a/database/tables_for_magic2.0/magic_apps_202602271731.sql b/database/tables_for_magic2.0/magic_apps_202602271731.sql new file mode 100644 index 0000000..066da21 --- /dev/null +++ b/database/tables_for_magic2.0/magic_apps_202602271731.sql @@ -0,0 +1,5 @@ +INSERT INTO custom.magic_apps (app_name,app_title,app_link,role_driver,access_groups_email,access_groups_ad,is_active) VALUES + ('Test','','test.index',NULL,NULL,'CTXAL.CryptoPRO',1), + ('About','','about',NULL,NULL,'CTXAL.CryptoPRO',1), + ('Test create','','test.create',NULL,NULL,'CTXAL.CryptoPRO',1), + ('taxi','Реестр заказа такси','test','email','# Magic_admins',NULL,1);