From c541c09277521ef983a3fe4ee9d75d20a5181351 Mon Sep 17 00:00:00 2001 From: vasya Date: Sat, 21 Mar 2026 19:51:37 +0300 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D1=8F?= =?UTF-8?q?=D1=8E=20=D0=BC=D0=BE=D0=B4=D0=B5=D0=BB=D1=8C=20=D1=80=D0=B0?= =?UTF-8?q?=D0=B1=D0=BE=D1=82=D1=8B=20=D1=81=D0=BE=20=D0=B2=D1=81=D0=B5?= =?UTF-8?q?=D0=BC=D0=B8=20=D0=BF=D1=80=D0=B8=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=D0=BC=D0=B8=20magic=202.0=20=D0=B8=20=D1=82=D0=B0?= =?UTF-8?q?=D0=B1=D0=BB=D0=B8=D1=86=D1=8B=20=D0=91=D0=94,=20=D0=B3=D0=B4?= =?UTF-8?q?=D0=B5=20=D1=85=D1=80=D0=B0=D0=BD=D1=8F=D1=82=D1=81=D1=8F=20?= =?UTF-8?q?=D0=BF=D1=80=D0=B8=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?magic=202.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Models/MagicApps.php | 19 +++++++++++++++++++ database/tables_for_magic2.0/magic_apps.sql | 13 +++++++++++++ .../magic_apps_202602271731.sql | 5 +++++ 3 files changed, 37 insertions(+) create mode 100644 app/Models/MagicApps.php create mode 100644 database/tables_for_magic2.0/magic_apps.sql create mode 100644 database/tables_for_magic2.0/magic_apps_202602271731.sql 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);