release version 1.10.0
This commit is contained in:
@ -0,0 +1,175 @@
|
||||
ЛИЦЕНЗИЯ ОГРАНИЧЕННОГО ПРИМЕНЕНИЯ
|
||||
|
||||
Настоящий документ устанавливает для Пользователя условия применения Базовой (некоммерческой)
|
||||
версии лицензии для пробного использования программного обеспечения ENTAXY, принадлежащего
|
||||
Правообладателю – Обществу с ограниченной ответственностью "ЕМДЕВ" (ОГРН 1057810026658, ИНН
|
||||
7813313860, юридический адрес: 197022, Россия, г. Санкт-Петербург, ул. Профессора Попова,
|
||||
д. 23, литера В, помещение 3Н), расположенной в сети Интернет по адресу
|
||||
https://www.emdev.ru/about (далее - Компания).
|
||||
|
||||
Используя или получая доступ к Программному обеспечению, или нажав «Я согласен с Условиями»
|
||||
(или аналогичную кнопку или флажок) после загрузки или установки Программного обеспечения,
|
||||
Пользователь выражает свое согласие на обязательность условий и ограничений, изложенных в
|
||||
настоящем документе, в противном случае, он должен не использовать или не получать доступ
|
||||
к Программному обеспечению.
|
||||
|
||||
1. ТЕРМИНЫ И ОПРЕДЕЛЕНИЯ
|
||||
|
||||
a) ПО – Программное обеспечение, интеграционная шина «ЭНТАКСИ» (ENTAXY) в любой ее версии
|
||||
или редакции, исключительные права на которую принадлежат Правообладателю.
|
||||
b) Правообладатель (Компания) – ООО «ЕМДЕВ», ОГРН 1057810026658, ИНН 7813313860, исключительные
|
||||
права которого подтверждаются Свидетельством о государственной регистрации в Реестре программ
|
||||
для ЭВМ № 2021610848 от 19.01.2021 года.
|
||||
c) Пользователь – юридическое или физическое лицо, получившее через скачивание с сайта
|
||||
https://entaxy.ru или иным образом, дистрибутив ПО, пользующееся ПО.
|
||||
d) ИС – интеллектуальная собственность – закреплённое законом исключительное право, а также
|
||||
личные неимущественные права авторов произведений на результат интеллектуальной деятельности.
|
||||
e) Подписка – это коммерческое предложение Правообладателя, состоящее из Лицензии на использование
|
||||
ПО и доступа к технической поддержке программного обеспечения на срок Подписки. Подписка
|
||||
включает предоставление Пользователю неисключительного права использования ПО, в том числе
|
||||
получение обновлений функционала ПО и безопасности ПО, исправление ошибок ПО и получение
|
||||
патчей с обновлениями и исправлениями программного обеспечения. Подписка приобретается
|
||||
Пользователем на период времени, указанный в Сертификате. Количество подписок устанавливается
|
||||
для каждого Пользователя индивидуально в Сертификате.
|
||||
f) Сертификат – документ, выдаваемый Дистрибъютором или Авторизованным партнёром (Партнёром),
|
||||
подтверждающий факт приобретения физическим или юридическим лицом Подписки на программное
|
||||
обеспечение в ограниченном объёме и на определённый период времени.
|
||||
g) Лицензия (простая (неисключительная) – совокупность ограниченных прав использования ПО,
|
||||
предоставленных Пользователю согласно условиям Подписки.
|
||||
h) Библиотека – совокупность подпрограмм и объектов, используемых для разработки программного
|
||||
обеспечения.
|
||||
i) Исходный код – текст компьютерной программы на каком-либо языке программирования, состоящий
|
||||
из одного или нескольких файлов, который может быть прочтён человеком.
|
||||
j) Объектный код – файл (часть машинного кода) с промежуточным представлением отдельного модуля
|
||||
программы, полученный в результате обработки исходного кода, еще не связанный в полную программу.
|
||||
Это машинный код для одной конкретной библиотеки или модуля, который будет составлять готовый
|
||||
продукт.
|
||||
k) Некоммерческое использование – индивидуальное личное использование Пользователем программного
|
||||
обеспечения с целью обучения работе с Программным обеспечением, для оценки или демонстрации
|
||||
возможностей Программного обеспечения, при котором, Пользователем не извлекается коммерческая
|
||||
выгода и/или не идёт в доход денежное вознаграждение при использовании Программного обеспечения.
|
||||
|
||||
2. ДОПУСТИМЫЕ СПОСОБЫ ИСПОЛЬЗОВАНИЯ ПРОГРАММНОГО ОБЕСПЕЧЕНИЯ
|
||||
|
||||
2.1. Правообладатель предоставляет Пользователю ограниченное право использования Программного
|
||||
обеспечения на условиях простой (неисключительной) лицензии в объёме, ограниченном правом
|
||||
воспроизведения полной рабочей версии программного обеспечения, новых версий программного обеспечения
|
||||
в памяти оборудования и его запуска на оборудовании в соответствии со ст. 1280 ГК РФ.
|
||||
2.2. Право на использование Программного обеспечения, предоставляемое Пользователю, носит
|
||||
неисключительный характер.
|
||||
2.3. Пользователю предоставляется всемирная, неисключительная, не подлежащая сублицензированию,
|
||||
лицензия на ограниченное использование Программного обеспечения.
|
||||
2.4. Пользователь, имеющий Базовую (некоммерческую) версию лицензии для пробного использования
|
||||
имеет право приобрести Подписку на программное обеспечение. В этом случае Пользователь обязан
|
||||
обратиться в службу поддержки Правообладателя по адресу: https://entaxy.ru/ для изменения
|
||||
вида лицензии с Базовой бесплатной версии на Подписки.
|
||||
2.5. Срок использования скачанной Пользователем базовой (некоммерческой) версии лицензии для
|
||||
пробного использования программного обеспечения – не ограничен.
|
||||
2.6. Использование Пользователем настоящего программного обеспечения в целях разработки,
|
||||
модификации, обновления другого ПО, принадлежащего третьим лицам, а не Правообладателю,
|
||||
без разрешения Правообладателя не допускается.
|
||||
|
||||
3. АВТОРСКОЕ ПРАВО.
|
||||
|
||||
3.1. Все авторские права, все права интеллектуальной собственности на Программное обеспечение
|
||||
и любые его копии принадлежат Правообладателю.
|
||||
3.2. Все авторские права, все права интеллектуальной собственности в отношении любого контента,
|
||||
к которому можно получить доступ с помощью Программного обеспечения, является собственностью
|
||||
соответствующего владельца контента и защищается применимым законодательством об авторском
|
||||
праве или другими законами и договорами об интеллектуальной собственности.
|
||||
3.3. Условия использования Программного обеспечения.
|
||||
Лицензия, предоставленная Пользователю, действительна только в том случае, если Пользователь
|
||||
придерживается следующих условий:
|
||||
3.3.1. Принятие уведомлений об авторских правах. Пользователю запрещается удалять или изменять
|
||||
какие-либо уведомления об авторских правах или лицензиях, которые появляются при использовании
|
||||
Программного обеспечения или на нем.
|
||||
3.3.2. Модификация. Пользователю запрещается модифицировать, изменять, декомпилировать,
|
||||
расшифровывать, дизассемблировать, переводить или реверсировать, перепроектировать
|
||||
Программное обеспечение.
|
||||
3.3.3. Распространение. Пользователю запрещается сублицензировать, передавать право использования
|
||||
ПО или иным образом распространять или предоставлять Программное обеспечение любой третьей стороне.
|
||||
3.3.4. SaaS. За исключением случаев, когда это разрешено Правообладателем, Пользователю запрещено
|
||||
использовать Программное обеспечение в коммерческих целях для оказания услуг третьим лицам.
|
||||
|
||||
4. ОТВЕТСТВЕННОСТЬ ПРАВООБЛАДАТЕЛЯ ПРИ НАРУШЕНИИ ПОЛЬЗОВАТЕЛЕМ ПРАВ «ИС»
|
||||
|
||||
4.1. Правообладатель не несет никаких обязательств в отношении каких-либо претензий к Пользователю
|
||||
на предмет нарушения последним прав Интеллектуальной собственности, возникших в связи с
|
||||
использованием Пользователем:
|
||||
4.1.1. Любых компонентов программного обеспечения с открытым исходным кодом, включенных в
|
||||
Программное обеспечение;
|
||||
4.1.2. Любого нарушения правил использования Программного обеспечения, установленного условиями
|
||||
настоящего соглашения;
|
||||
4.1.3. Любого использования Программного обеспечения в сочетании с другими ПО, оборудованием,
|
||||
или данными, не предоставленными Пользователю Правообладателем;
|
||||
4.1.4. Любого изменения Программного обеспечения любым третьим лицом, а не Правообладателем.
|
||||
|
||||
|
||||
5. НАСТОЯЩИМ ПРАВООБЛАДАТЕЛЬ ЗАЯВЛЯЕТ, ЧТО ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ ПРЕДОСТАВЛЯЕТСЯ ПОЛЬЗОВАТЕЛЮ
|
||||
ПО ПРИНЦИПУ «AS IS» - «КАК ЕСТЬ». НИ ПРИ КАКИХ ОБСТОЯТЕЛЬСТВАХ ПРАВООБЛАДАТЕЛЬ НЕ ГАРАНТИРУЕТ
|
||||
И НЕ ОБЕЩАЕТ, ЧТО ПРЕДОСТАВЛЕННОЕ ИМ ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ БУДЕТ ПОДХОДИТЬ ИЛИ НЕ ПОДХОДИТЬ
|
||||
ДЛЯ КОНКРЕТНЫХ ЦЕЛЕЙ ПОЛЬЗОВАТЕЛЯ, ЧТО ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ БУДЕТ ОТВЕЧАТЬ ВСЕМ КОММЕРЧЕСКИМ
|
||||
И ЛИЧНЫМ СУБЪЕКТИВНЫМ ОЖИДАНИЯМ ПОЛЬЗОВАТЕЛЯ, ЧТО ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ БУДЕТ РАБОТАТЬ
|
||||
ИСПРАВНО, БЕЗ ТЕХНИЧЕСКИХ ОШИБОК, БЫСТРО И БЕСПЕРЕБОЙНО.
|
||||
|
||||
6. ОГРАНИЧЕНИЕ ОТВЕТСТВЕННОСТИ.
|
||||
НИ ПРИ КАКИХ ОБСТОЯТЕЛЬСТВАХ ПРАВООБЛАДАТЕЛЬ ИЛИ ЕГО АФФИЛЛИРОВАННЫЕ ЛИЦА НЕ НЕСУТ ПЕРЕД ПОЛЬЗОВАТЕЛЕМ
|
||||
ОТВЕТСТВЕННОСТИ ЗА ЛЮБЫЕ ПРЯМЫЕ ИЛИ КОСВЕННЫЕ УБЫТКИ ПОЛЬЗОВАТЕЛЯ, ЕГО РАСХОДЫ ИЛИ РЕАЛЬНЫЙ УЩЕРБ,
|
||||
ВКЛЮЧАЯ, ПОМИМО ПРОЧЕГО, ПРОСТОИ; УТРАТУ БИЗНЕСА; УПУЩЕННУЮ ВЫГОДУ; НЕДОПОЛУЧЕННУЮ ПРИБЫЛЬ;
|
||||
ПОТЕРЮ ИЛИ ПОВРЕЖДЕНИЕ ДАННЫХ, ИМУЩЕСТВА И ИНОЕ.
|
||||
ОГРАНИЧЕНИЯ ПРИМЕНЯЮТСЯ НЕЗАВИСИМО ОТ ОСНОВАНИЯ НАСТУПЛЕНИЯ ОТВЕТСТВЕННОСТИ; В ТОМ ЧИСЛЕ ВСЛЕДСТВИЕ
|
||||
ДЕЙСТВИЯ ИЛИ БЕЗДЕЙСТВИЯ, НЕБРЕЖНОСТИ, УМЫСЛА, ПРЯМОГО ИЛИ КОСВЕННОГО; НЕОСТОРОЖНОСТИ; ЗАБЛУЖДЕНИЯ;
|
||||
КЛЕВЕТЫ; НАРУШЕНИЯ КОНФИДЕНЦИАЛЬНОСТИ ИЛИ ПРАВА ИНТЕЛЛЕКТУАЛЬНОЙ СОБСТВЕННОСТИ; ИЛИ ЛЮБОЕ ДРУГОЕ
|
||||
ОСНОВАНИЕ НАСТУПЛЕНИЯ ОТВЕТСТВЕННОСТИ.
|
||||
|
||||
7. ОБЯЗАННОСТЬ ПОЛЬЗОВАТЕЛЯ:
|
||||
Не осуществлять самостоятельно и (или) с привлечением третьих лиц нижеследующие действия
|
||||
(включая, но не ограничиваясь) по:
|
||||
-дизассемблированию и (или) декомпилированию (преобразованию объектного кода в исходный код)
|
||||
Программного обеспечения;
|
||||
-модификации Программного обеспечения, в том числе вносить изменения в объектный код, исходный
|
||||
код Программного обеспечения, за исключением тех изменений, которые вносятся средствами,
|
||||
включёнными в Программное обеспечение и описанными непосредственно в документации к нему;
|
||||
-созданию условий для использования Программного обеспечения лицами, не имеющими прав на
|
||||
использование данного Программного обеспечения, включая (но не ограничиваясь) вмешательство
|
||||
третьих лиц в функционирование Программного обеспечения, предоставление третьим лицам доступа
|
||||
к исследованию и (или) замене настроек Программного обеспечения, включая его первичную установку;
|
||||
-распространению Программного обеспечения в целом или в части (включая приложенную к нему документацию).
|
||||
|
||||
8. БИБЛИОТЕКА ПО. ИСПОЛЬЗУЕМЫЕ ПРОГРАММНЫЕ СРЕДСТВА.
|
||||
|
||||
8.1. Настоящим, Правообладатель заверяет, что Библиотека программного обеспечения состоит из
|
||||
лицензионных продуктов, используемых на законных основаниях, а
|
||||
именно https://entaxy.ru/libs/licenses/root-aggregated.deps.
|
||||
8.2. Любые программные средства, применяемые Пользователем при работе с ПО, должны быть
|
||||
совместимы с библиотекой ПО, указанной в п.8.1. настоящего соглашения.
|
||||
8.3. Перечень внешних модулей ПО, указанный в п.8.1 настоящего соглашения, может изменяться
|
||||
Правообладателем в одностороннем порядке, в зависимости от выпуска релизов программного обеспечения,
|
||||
содержащих все изменения и дополнения программного обеспечения.
|
||||
|
||||
9. ВНЕСЕНИЕ ИЗМЕНЕНИЙ В ПРОГРАММНОЕ ОБЕСПЕЧЕНИЕ.
|
||||
|
||||
9.1. Программное обеспечение, интеграционная шина «ЭНТАКСИ» (ENTAXY) является свободно распространяемым
|
||||
программным обеспечением.
|
||||
9.2. Пользователь имеет право вносить изменения в исходный код программного обеспечения исключительно
|
||||
с согласия Правообладателя в порядке предложения изменений/правок/дополнений через механизм
|
||||
«Pull Requests» в открытом репозитории Правообладателя по адресу: https://git.entaxy.ru/entaxy/entaxy-public.
|
||||
9.3. Любые изменения программного обеспечения, осуществляемые Пользователем без соблюдения условий
|
||||
пункта 9.2. настоящего документа, являются нарушением авторских и смежных прав Правообладателя,
|
||||
прав интеллектуальной собственности Правообладателя и влекут применение к Пользователю мер
|
||||
ответственности в соответствии с условиями настоящей Лицензии, а также применимого законодательства
|
||||
Российской Федерации.
|
||||
|
||||
10. ЗАКЛЮЧИТЕЛЬНЫЕ ПОЛОЖЕНИЯ.
|
||||
|
||||
10.1. В случае нарушения Пользователем любого из условий настоящей Лицензии, Правообладатель имеет
|
||||
право взыскать с Пользователя любые причинённые таким нарушением убытки, реальный ущерб,
|
||||
недополученную прибыль, упущенную выгоду, а также в случае нарушения Пользователем условий
|
||||
пункта 9.2 настоящего соглашения, в том числе, взыскать с Пользователя штраф в размере
|
||||
2 000 000 (Два миллиона) рублей за каждый установленный случай несанкционированного изменения
|
||||
исходного или объектного кода Программного обеспечения «Энтакси» (Entaxy).
|
||||
10.2. В рамках исполнения Пользователем обязательств по настоящей Лицензии, применимое
|
||||
законодательство – Российской Федерации.
|
||||
10.3. Если какое-либо положение настоящей Лицензии будет признано судом недействительным,
|
||||
остальные положения будут продолжать своё действие, а Пользователь будет обязан продолжать
|
||||
исполнять свои обязанности в соответствии с этими положениями.
|
@ -0,0 +1,78 @@
|
||||
# SYSTEM :: ENTAXY :: CORE :: PERMISSION :: COMPONENT
|
||||
|
||||
Схема компонента: **permission**
|
||||
|
||||
Поддерживаемые операции:
|
||||
|
||||
- check - проверка права, принимает параметры
|
||||
* objectId (long) - идентификатор объекта, для которого проверяются права
|
||||
* objectType (String) - тип объекта, данный параметр соответствует проектной терминалогии: system, system-group
|
||||
* subjectId (String) - идентификатор предмета применяемого права
|
||||
* subjectType (String) - тип предмета
|
||||
* action (String, не обязательный)- тип действия, по умолчанию проставляется значение default
|
||||
Возвращает в тело запроса boolean
|
||||
|
||||
- checkException - проверка права, принимает параметры
|
||||
* objectId (long) - идентификатор объекта, для которого проверяются права
|
||||
* objectType (String) - тип объекта, данный параметр соответствует проектной терминалогии: system, system-group
|
||||
* subjectId (String) - идентификатор предмета применяемого права
|
||||
* subjectType (String) - тип предмета
|
||||
* action (String, не обязательный)- тип действия, по умолчанию проставляется значение default
|
||||
При положительном результате не меняет данных, при отрицательном выбрасывает IllegalAccessException
|
||||
|
||||
- checkSystemAccess - проверка доступа системы к системе, type проставляется по умолчанию system,
|
||||
принимает параметры
|
||||
* objectId (long) - идентификатор системы, для которой проверяются права
|
||||
* subjectId (String) - идентификатор/имя/uuid системы применяемого права
|
||||
* action (String, не обязательный)- тип действия, по умолчанию проставляется значение default
|
||||
Возвращает в тело запроса boolean, в случае если система subject не найдена возвращается false
|
||||
|
||||
- checkSystemAccessException - проверка доступа системы к системе, type проставляется по умолчанию system,
|
||||
принимает параметры
|
||||
* objectId (long) - идентификатор системы, для которой проверяются права
|
||||
* subjectId (String) - идентификатор/имя/uuid системы применяемого права
|
||||
* action (String, не обязательный)- тип действия, по умолчанию проставляется значение default
|
||||
При положительном результате не меняет данных, при отрицательном выбрасывает IllegalAccessException
|
||||
|
||||
- get - получение объекта permission, принимает параметры
|
||||
* permissionId (long) - идентификатор объекта permission
|
||||
Возвращает в тело запроса объект Permission
|
||||
|
||||
- getByAllParams - получение объекта permission, принимает параметры
|
||||
* objectId
|
||||
* objectType
|
||||
* subjectId
|
||||
* subjectType
|
||||
* action (не обязательный)
|
||||
Возвращает в тело запроса объект Permission
|
||||
|
||||
- create - создаёт Permission c заданными параметрами
|
||||
* objectId
|
||||
* objectType
|
||||
* subjectId
|
||||
* subjectType
|
||||
* action (не обязательный)
|
||||
Возвращает в тело запроса объект Permission
|
||||
|
||||
- update - обновляет либо создаёт Permission
|
||||
* permissionId
|
||||
* objectId
|
||||
* objectType
|
||||
* subjectId
|
||||
* subjectType
|
||||
* action (не обязательный)
|
||||
Возвращает в тело запроса объект Permission
|
||||
|
||||
- delete - удаляет permission
|
||||
* objectId
|
||||
* objectType
|
||||
* subjectId
|
||||
* subjectType
|
||||
* action (не обязательный)
|
||||
Возвращает в тело запроса boolean
|
||||
|
||||
Пример вызова в XML-DSL:
|
||||
|
||||
```
|
||||
<to uri="permission:check?objectId=2&objectType=system&subjectId=4&subjectType=system&action=send" />
|
||||
```
|
@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
|
||||
|
||||
<parent>
|
||||
<groupId>ru.entaxy.platform.security</groupId>
|
||||
<artifactId>legacy-permissions</artifactId>
|
||||
<version>1.10.0</version>
|
||||
</parent>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>ru.entaxy.esb.system.core.permission</groupId>
|
||||
<artifactId>permission-component</artifactId>
|
||||
<packaging>bundle</packaging>
|
||||
|
||||
<name>SYSTEM :: ENTAXY :: CORE :: PERMISSION :: COMPONENT</name>
|
||||
<description>SYSTEM :: ENTAXY :: CORE :: PERMISSION :: COMPONENT</description>
|
||||
|
||||
<properties>
|
||||
<bundle.osgi.export.service>org.apache.camel.spi.ComponentResolver;component=permission
|
||||
</bundle.osgi.export.service>
|
||||
<bundle.osgi.import.pkg>
|
||||
ru.entaxy.esb.system.common.osgi,
|
||||
ru.entaxy.esb.system.common.osgi.impl,
|
||||
javax.persistence;version="[2,3)",
|
||||
*
|
||||
</bundle.osgi.import.pkg>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.platform.runtime.base</groupId>
|
||||
<artifactId>base-support</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.system.core.permission</groupId>
|
||||
<artifactId>permission-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>ru.entaxy.esb.system.core.permission</groupId>
|
||||
<artifactId>permission-common</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- testing -->
|
||||
<dependency>
|
||||
<groupId>org.apache.camel</groupId>
|
||||
<artifactId>camel-test</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.camel</groupId>
|
||||
<artifactId>camel-core</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
@ -0,0 +1,45 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* permission-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.core.permission.component;
|
||||
|
||||
import org.apache.camel.Endpoint;
|
||||
import org.apache.camel.support.DefaultComponent;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public class PermissionComponent extends DefaultComponent {
|
||||
|
||||
@Override
|
||||
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
|
||||
PermissionEndpoint endpoint = new PermissionEndpoint(uri, this);
|
||||
|
||||
endpoint.setOperation(remaining);
|
||||
|
||||
setProperties(endpoint, parameters);
|
||||
return endpoint;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,138 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* permission-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.core.permission.component;
|
||||
|
||||
import org.apache.camel.Consumer;
|
||||
import org.apache.camel.Processor;
|
||||
import org.apache.camel.Producer;
|
||||
import org.apache.camel.spi.Metadata;
|
||||
import org.apache.camel.spi.UriEndpoint;
|
||||
import org.apache.camel.spi.UriParam;
|
||||
import org.apache.camel.spi.UriPath;
|
||||
import org.apache.camel.support.DefaultEndpoint;
|
||||
|
||||
@UriEndpoint(
|
||||
scheme = "permission",
|
||||
title = "Permission",
|
||||
syntax = "permission:operation",
|
||||
label = "custom",
|
||||
producerOnly = true)
|
||||
public class PermissionEndpoint extends DefaultEndpoint {
|
||||
|
||||
@UriPath
|
||||
@Metadata(required = true)
|
||||
private String operation;
|
||||
|
||||
@UriParam
|
||||
private long permissionId;
|
||||
@UriParam
|
||||
private long objectId;
|
||||
@UriParam
|
||||
private String objectType;
|
||||
@UriParam
|
||||
private String subjectId;
|
||||
@UriParam
|
||||
private String subjectType;
|
||||
@UriParam
|
||||
private String action;
|
||||
|
||||
|
||||
public PermissionEndpoint() {
|
||||
}
|
||||
|
||||
public PermissionEndpoint(String uri, PermissionComponent component) {
|
||||
super(uri, component);
|
||||
}
|
||||
|
||||
public Producer createProducer() throws Exception {
|
||||
return new PermissionProducer(this);
|
||||
}
|
||||
|
||||
public Consumer createConsumer(Processor processor) throws Exception {
|
||||
return null;
|
||||
}
|
||||
|
||||
public boolean isSingleton() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public String getOperation() {
|
||||
return operation;
|
||||
}
|
||||
|
||||
public void setOperation(String operation) {
|
||||
this.operation = operation;
|
||||
}
|
||||
|
||||
public long getPermissionId() {
|
||||
return permissionId;
|
||||
}
|
||||
|
||||
public void setPermissionId(long permissionId) {
|
||||
this.permissionId = permissionId;
|
||||
}
|
||||
|
||||
public long getObjectId() {
|
||||
return objectId;
|
||||
}
|
||||
|
||||
public void setObjectId(long objectId) {
|
||||
this.objectId = objectId;
|
||||
}
|
||||
|
||||
public String getObjectType() {
|
||||
return objectType;
|
||||
}
|
||||
|
||||
public void setObjectType(String objectType) {
|
||||
this.objectType = objectType;
|
||||
}
|
||||
|
||||
public String getSubjectId() {
|
||||
return subjectId;
|
||||
}
|
||||
|
||||
public void setSubjectId(String subjectId) {
|
||||
this.subjectId = subjectId;
|
||||
}
|
||||
|
||||
public String getSubjectType() {
|
||||
return subjectType;
|
||||
}
|
||||
|
||||
public void setSubjectType(String subjectType) {
|
||||
this.subjectType = subjectType;
|
||||
}
|
||||
|
||||
public String getAction() {
|
||||
return action;
|
||||
}
|
||||
|
||||
public void setAction(String action) {
|
||||
this.action = action;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* permission-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.core.permission.component;
|
||||
|
||||
import org.apache.camel.Exchange;
|
||||
import org.apache.camel.support.DefaultProducer;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import ru.entaxy.esb.system.core.permission.component.operation.OperationFactory;
|
||||
|
||||
public class PermissionProducer extends DefaultProducer {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(PermissionProducer.class);
|
||||
private final PermissionEndpoint endpoint;
|
||||
|
||||
public PermissionProducer(PermissionEndpoint endpoint) {
|
||||
super(endpoint);
|
||||
this.endpoint = endpoint;
|
||||
}
|
||||
|
||||
public void process(Exchange exchange) throws Exception {
|
||||
String operation = endpoint.getOperation();
|
||||
|
||||
LOG.debug("In PermissionProducer " + endpoint.getPermissionId() + " " + endpoint.getObjectId() + " " + endpoint.getObjectType() + " "
|
||||
+ endpoint.getSubjectId() + " " + endpoint.getSubjectType() + " " + endpoint.getAction());
|
||||
|
||||
OperationFactory.getOperation(operation).process(exchange, endpoint);
|
||||
|
||||
}
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* permission-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.core.permission.component.exception;
|
||||
|
||||
public class UnknownOperationException extends Exception {
|
||||
|
||||
private static final long serialVersionUID = 948229285513408917L;
|
||||
|
||||
public UnknownOperationException() {
|
||||
super();
|
||||
}
|
||||
|
||||
public UnknownOperationException(String message, Throwable cause, boolean enableSuppression,
|
||||
boolean writableStackTrace) {
|
||||
super(message, cause, enableSuppression, writableStackTrace);
|
||||
}
|
||||
|
||||
public UnknownOperationException(String message, Throwable cause) {
|
||||
super(message, cause);
|
||||
}
|
||||
|
||||
public UnknownOperationException(String message) {
|
||||
super(message);
|
||||
}
|
||||
|
||||
public UnknownOperationException(Throwable cause) {
|
||||
super(cause);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* permission-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.core.permission.component.operation;
|
||||
|
||||
|
||||
import org.apache.camel.Exchange;
|
||||
import org.osgi.framework.FrameworkUtil;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ru.entaxy.esb.system.core.permission.component.PermissionEndpoint;
|
||||
import ru.entaxy.esb.system.core.permission.component.PermissionProducer;
|
||||
import ru.entaxy.esb.system.core.permission.jpa.PermissionService;
|
||||
import ru.entaxy.platform.base.support.osgi.OSGIUtils;
|
||||
|
||||
public abstract class BaseOperation implements Operation {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(BaseOperation.class);
|
||||
|
||||
private PermissionService permissionService;
|
||||
|
||||
// private SystemService systemService;
|
||||
|
||||
@Override
|
||||
public void process(Exchange exchange, PermissionEndpoint endpoint) throws Exception {
|
||||
doProcess(exchange, endpoint);
|
||||
}
|
||||
|
||||
protected abstract void doProcess(Exchange exchange, PermissionEndpoint endpoint) throws Exception;
|
||||
|
||||
protected void validateParams(String... parameters) {
|
||||
for (String parameter : parameters) {
|
||||
if (parameter == null || "0".equals(parameter) || parameter.isEmpty()) {
|
||||
throw new IllegalArgumentException("One or more parameters empty!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected PermissionService getPermissionService() {
|
||||
if (permissionService == null) {
|
||||
permissionService = (PermissionService) OSGIUtils.getService(
|
||||
FrameworkUtil.getBundle(PermissionProducer.class).getBundleContext(),
|
||||
PermissionService.class);
|
||||
}
|
||||
return permissionService;
|
||||
}
|
||||
/*
|
||||
protected SystemService getSystemService() {
|
||||
if (systemService == null) {
|
||||
systemService = (SystemService) OSGIUtils.getServiceReference(
|
||||
FrameworkUtil.getBundle(PermissionProducer.class).getBundleContext(),
|
||||
SystemService.class.getName());
|
||||
}
|
||||
return systemService;
|
||||
}
|
||||
*/
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* permission-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.core.permission.component.operation;
|
||||
|
||||
import org.apache.camel.Exchange;
|
||||
import ru.entaxy.esb.system.core.permission.component.PermissionEndpoint;
|
||||
|
||||
public class BulkCreate extends BaseOperation {
|
||||
|
||||
@Override
|
||||
protected void doProcess(Exchange exchange, PermissionEndpoint endpoint) throws Exception {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,47 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* permission-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.core.permission.component.operation;
|
||||
|
||||
import org.apache.camel.Exchange;
|
||||
import ru.entaxy.esb.system.core.permission.component.PermissionEndpoint;
|
||||
|
||||
public class Check extends BaseOperation {
|
||||
|
||||
@Override
|
||||
protected void doProcess(Exchange exchange, PermissionEndpoint endpoint) throws Exception {
|
||||
validateParams(String.valueOf(endpoint.getObjectId()), endpoint.getObjectType(),
|
||||
endpoint.getSubjectId(), endpoint.getSubjectType());
|
||||
exchange.getIn().setBody(check(endpoint), Boolean.class);
|
||||
|
||||
}
|
||||
|
||||
protected boolean check(PermissionEndpoint endpoint) {
|
||||
return getPermissionService().existByAllParameters(endpoint.getObjectId(), endpoint.getObjectType(),
|
||||
endpoint.getSubjectId(), endpoint.getSubjectType(), endpoint.getAction());
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,80 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* permission-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.core.permission.component.operation;
|
||||
|
||||
import org.apache.camel.Exchange;
|
||||
|
||||
import ru.entaxy.esb.system.core.permission.component.PermissionEndpoint;
|
||||
// import ru.entaxy.esb.system.jpa.entity.System;
|
||||
|
||||
public class CheckSystemAccess extends BaseOperation {
|
||||
|
||||
@Override
|
||||
protected void doProcess(Exchange exchange, PermissionEndpoint endpoint) throws Exception {
|
||||
validateParams(String.valueOf(endpoint.getObjectId()), endpoint.getSubjectId());
|
||||
exchange.getIn().setBody(checkSystemAccessProc(endpoint), Boolean.class);
|
||||
}
|
||||
|
||||
protected boolean checkSystemAccessProc(PermissionEndpoint endpoint) {
|
||||
return true;
|
||||
/*
|
||||
System system = getSystem(endpoint.getSubjectId());
|
||||
boolean result = false;
|
||||
if (system != null) {
|
||||
result = getPermissionService().existByAllParameters(endpoint.getObjectId(),
|
||||
PermissionConstants.TYPE_SYSTEM,
|
||||
String.valueOf(system.getId()), PermissionConstants.TYPE_SYSTEM, endpoint.getAction());
|
||||
}
|
||||
return result;
|
||||
*/
|
||||
}
|
||||
|
||||
/*
|
||||
protected System getSystem(String subject) {
|
||||
try {
|
||||
long systemId = Long.valueOf(subject);
|
||||
return getSystemService().get(systemId);
|
||||
} catch (Exception e) {
|
||||
// keep silence
|
||||
}
|
||||
System system = null;
|
||||
try {
|
||||
system = getSystemService().getByName(subject);
|
||||
return system;
|
||||
} catch (NoResultException e) {
|
||||
// keep silence
|
||||
}
|
||||
|
||||
try {
|
||||
system = getSystemService().getByUuid(subject);
|
||||
} catch (NoResultException e) {
|
||||
// keep silence
|
||||
}
|
||||
|
||||
return system;
|
||||
}
|
||||
*/
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* permission-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.core.permission.component.operation;
|
||||
|
||||
import org.apache.camel.Exchange;
|
||||
|
||||
import ru.entaxy.esb.system.core.permission.component.PermissionEndpoint;
|
||||
// import ru.entaxy.esb.system.jpa.entity.System;
|
||||
|
||||
public class CheckSystemAccessWithException extends CheckSystemAccess {
|
||||
|
||||
@Override
|
||||
protected void doProcess(Exchange exchange, PermissionEndpoint endpoint) throws IllegalAccessException {
|
||||
/*
|
||||
validateParams(String.valueOf(endpoint.getObjectId()), endpoint.getSubjectId());
|
||||
if (!checkSystemAccessProc(endpoint)) {
|
||||
if (endpoint.getSubjectId().equals("error")) return;
|
||||
System system = getSystem(endpoint.getSubjectId());
|
||||
if (system.getId() == endpoint.getObjectId()) return;
|
||||
throw new IllegalAccessException("Connection to system " + endpoint.getSubjectId() + " is not allowed");
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* permission-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.core.permission.component.operation;
|
||||
|
||||
import org.apache.camel.Exchange;
|
||||
import ru.entaxy.esb.system.core.permission.component.PermissionEndpoint;
|
||||
|
||||
public class CheckWithException extends Check {
|
||||
@Override
|
||||
protected void doProcess(Exchange exchange, PermissionEndpoint endpoint) throws IllegalAccessException {
|
||||
validateParams(String.valueOf(endpoint.getObjectId()), endpoint.getObjectType(),
|
||||
endpoint.getSubjectId(), endpoint.getSubjectType());
|
||||
if (!check(endpoint)) {
|
||||
throw new IllegalAccessException();
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* permission-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.core.permission.component.operation;
|
||||
|
||||
import org.apache.camel.Exchange;
|
||||
import ru.entaxy.esb.system.core.permission.component.PermissionEndpoint;
|
||||
|
||||
public class Create extends BaseOperation {
|
||||
|
||||
@Override
|
||||
protected void doProcess(Exchange exchange, PermissionEndpoint endpoint) throws Exception {
|
||||
validateParams(String.valueOf(endpoint.getObjectId()), endpoint.getObjectType(),
|
||||
endpoint.getSubjectId(), endpoint.getSubjectType());
|
||||
exchange.getIn().setBody(getPermissionService().add(endpoint.getObjectId(), endpoint.getObjectType(),
|
||||
endpoint.getSubjectId(), endpoint.getSubjectType(), endpoint.getAction()));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* permission-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.core.permission.component.operation;
|
||||
|
||||
import org.apache.camel.Exchange;
|
||||
import ru.entaxy.esb.system.core.permission.component.PermissionEndpoint;
|
||||
|
||||
public class Delete extends BaseOperation {
|
||||
|
||||
@Override
|
||||
protected void doProcess(Exchange exchange, PermissionEndpoint endpoint) throws Exception {
|
||||
validateParams(String.valueOf(endpoint.getObjectId()), endpoint.getObjectType(),
|
||||
endpoint.getSubjectId(), endpoint.getSubjectType());
|
||||
try {
|
||||
getPermissionService().remove(endpoint.getObjectId(), endpoint.getObjectType(),
|
||||
endpoint.getSubjectId(), endpoint.getSubjectType(), endpoint.getAction());
|
||||
exchange.getIn().setBody(true, Boolean.class);
|
||||
} catch (Exception e) {
|
||||
exchange.getIn().setBody(false, Boolean.class);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,39 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* permission-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.core.permission.component.operation;
|
||||
|
||||
import org.apache.camel.Exchange;
|
||||
import ru.entaxy.esb.system.core.permission.component.PermissionEndpoint;
|
||||
|
||||
public class Get extends BaseOperation {
|
||||
|
||||
@Override
|
||||
protected void doProcess(Exchange exchange, PermissionEndpoint endpoint) throws Exception {
|
||||
validateParams(String.valueOf(endpoint.getPermissionId()));
|
||||
exchange.getIn().setBody(getPermissionService().get(endpoint.getPermissionId()));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* permission-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.core.permission.component.operation;
|
||||
|
||||
import org.apache.camel.Exchange;
|
||||
import ru.entaxy.esb.system.core.permission.component.PermissionEndpoint;
|
||||
|
||||
public class GetByAllParams extends BaseOperation {
|
||||
|
||||
@Override
|
||||
protected void doProcess(Exchange exchange, PermissionEndpoint endpoint) throws Exception {
|
||||
validateParams(String.valueOf(endpoint.getObjectId()), endpoint.getObjectType(),
|
||||
endpoint.getSubjectId(), endpoint.getSubjectType());
|
||||
exchange.getIn().setBody(getPermissionService().getByAllParameters(endpoint.getObjectId(), endpoint.getObjectType(),
|
||||
endpoint.getSubjectId(), endpoint.getSubjectType(), endpoint.getAction()));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* permission-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.core.permission.component.operation;
|
||||
|
||||
import org.apache.camel.Exchange;
|
||||
import ru.entaxy.esb.system.core.permission.component.PermissionEndpoint;
|
||||
|
||||
public interface Operation {
|
||||
|
||||
void process(Exchange exchange, PermissionEndpoint endpoint) throws Exception;
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* permission-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.core.permission.component.operation;
|
||||
|
||||
import ru.entaxy.esb.system.core.permission.component.exception.UnknownOperationException;
|
||||
import ru.entaxy.esb.system.core.permission.component.util.PermissionComponentConstants;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class OperationFactory {
|
||||
|
||||
private static final Map<String, Operation> operations;
|
||||
|
||||
static {
|
||||
operations = new HashMap<>();
|
||||
operations.put(PermissionComponentConstants.OPERATION_CHECK, new Check());
|
||||
operations.put(PermissionComponentConstants.OPERATION_CHECK_EXCEPTION, new CheckWithException());
|
||||
operations.put(PermissionComponentConstants.OPERATION_CHECK_SYSTEM_ACCESS, new CheckSystemAccess());
|
||||
operations.put(PermissionComponentConstants.OPERATION_CHECK_SYSTEM_ACCESS_EXCEPTION, new CheckSystemAccessWithException());
|
||||
operations.put(PermissionComponentConstants.OPERATION_CREATE, new Create());
|
||||
operations.put(PermissionComponentConstants.OPERATION_DELETE, new Delete());
|
||||
operations.put(PermissionComponentConstants.OPERATION_GET, new Get());
|
||||
operations.put(PermissionComponentConstants.OPERATION_GET_BY_ALL_PARAM, new GetByAllParams());
|
||||
operations.put(PermissionComponentConstants.OPERATION_UPDATE, new Update());
|
||||
}
|
||||
|
||||
public static final Operation getOperation(String name) throws UnknownOperationException {
|
||||
if (operations.containsKey(name)) {
|
||||
return operations.get(name);
|
||||
}
|
||||
throw new UnknownOperationException();
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* permission-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.core.permission.component.operation;
|
||||
|
||||
import org.apache.camel.Exchange;
|
||||
import ru.entaxy.esb.system.core.permission.component.PermissionEndpoint;
|
||||
|
||||
public class Update extends BaseOperation {
|
||||
|
||||
@Override
|
||||
protected void doProcess(Exchange exchange, PermissionEndpoint endpoint) throws Exception {
|
||||
validateParams(String.valueOf(endpoint.getObjectId()), endpoint.getObjectType(),
|
||||
endpoint.getSubjectId(), endpoint.getSubjectType());
|
||||
exchange.getIn().setBody(getPermissionService().update(endpoint.getPermissionId(), endpoint.getObjectId(), endpoint.getObjectType(),
|
||||
endpoint.getSubjectId(), endpoint.getSubjectType(), endpoint.getAction()));
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
/*-
|
||||
* ~~~~~~licensing~~~~~~
|
||||
* permission-component
|
||||
* ==========
|
||||
* Copyright (C) 2020 - 2024 EmDev LLC
|
||||
* ==========
|
||||
* You may not use this file except in accordance with the License Terms of the Copyright
|
||||
* Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
* rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
* it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
* Software for commercial purposes to provide services to third parties.
|
||||
*
|
||||
* The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
* Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
* Software provided by him will be suitable or not suitable for the specific purposes
|
||||
* of the User, that the Software will meet all commercial and personal subjective
|
||||
* expectations of the User, that the Software will work properly, without technical
|
||||
* errors, quickly and uninterruptedly.
|
||||
*
|
||||
* Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
* to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
* damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
* or damage to data, property, etc.
|
||||
* ~~~~~~/licensing~~~~~~
|
||||
*/
|
||||
package ru.entaxy.esb.system.core.permission.component.util;
|
||||
|
||||
public class PermissionComponentConstants {
|
||||
|
||||
public static final String OPERATION_CHECK = "check";
|
||||
public static final String OPERATION_CHECK_EXCEPTION = "checkException";
|
||||
public static final String OPERATION_CHECK_SYSTEM_ACCESS = "checkSystemAccess";
|
||||
public static final String OPERATION_CHECK_SYSTEM_ACCESS_EXCEPTION = "checkSystemAccessException";
|
||||
public static final String OPERATION_GET = "get";
|
||||
public static final String OPERATION_GET_BY_ALL_PARAM = "getByAllParams";
|
||||
public static final String OPERATION_CREATE = "create";
|
||||
public static final String OPERATION_UPDATE = "update";
|
||||
public static final String OPERATION_DELETE = "delete";
|
||||
|
||||
private PermissionComponentConstants() {
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
class=ru.entaxy.esb.system.core.permission.component.PermissionComponent
|
@ -0,0 +1,36 @@
|
||||
###
|
||||
# ~~~~~~licensing~~~~~~
|
||||
# permission-component
|
||||
# ==========
|
||||
# Copyright (C) 2020 - 2024 EmDev LLC
|
||||
# ==========
|
||||
# You may not use this file except in accordance with the License Terms of the Copyright
|
||||
# Holder located at: https://entaxy.ru/eula . All copyrights, all intellectual property
|
||||
# rights to the Software and any copies are the property of the Copyright Holder. Unless
|
||||
# it is explicitly allowed the Copyright Holder, the User is prohibited from using the
|
||||
# Software for commercial purposes to provide services to third parties.
|
||||
#
|
||||
# The Copyright Holder hereby declares that the Software is provided on an "AS IS".
|
||||
# Under no circumstances does the Copyright Holder guarantee or promise that the
|
||||
# Software provided by him will be suitable or not suitable for the specific purposes
|
||||
# of the User, that the Software will meet all commercial and personal subjective
|
||||
# expectations of the User, that the Software will work properly, without technical
|
||||
# errors, quickly and uninterruptedly.
|
||||
#
|
||||
# Under no circumstances shall the Copyright Holder or its Affiliates is not liable
|
||||
# to the User for any direct or indirect losses of the User, his expenses or actual
|
||||
# damage, including, downtime; loss of bussines; lost profit; lost earnings; loss
|
||||
# or damage to data, property, etc.
|
||||
# ~~~~~~/licensing~~~~~~
|
||||
###
|
||||
appender.file.type=File
|
||||
appender.file.name=file
|
||||
appender.file.fileName=target/camel-test.log
|
||||
appender.file.layout.type=PatternLayout
|
||||
appender.file.layout.pattern=%d %-5p %c{1} - %m %n
|
||||
appender.out.type=Console
|
||||
appender.out.name=out
|
||||
appender.out.layout.type=PatternLayout
|
||||
appender.out.layout.pattern=[%30.30t] %-30.30c{1} %-5p %m%n
|
||||
rootLogger.level=INFO
|
||||
rootLogger.appenderRef.out.ref=out
|
Reference in New Issue
Block a user