Skip to content
Snippets Groups Projects
Commit 2a152c3d authored by Simon Leipold's avatar Simon Leipold
Browse files

[Projekt: Entwicklung - Neon][TicketNr.: 1053501][Berechtigungshierarchie -...

[Projekt: Entwicklung - Neon][TicketNr.: 1053501][Berechtigungshierarchie - Anzeige von parent role]
parent ddf87832
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.13" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.13">
<name>RoleChildren_entity</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<title>Child</title>
<title>Child Role</title>
<titlePlural>Child Roles</titlePlural>
<recordContainer>jDito</recordContainer>
<entityFields>
......
<?xml version="1.0" encoding="UTF-8"?>
<entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.13" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.13">
<name>RoleParent_entity</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<title>Parent Role</title>
<titlePlural>Parent Roles</titlePlural>
<recordContainer>jDito</recordContainer>
<entityFields>
<entityProvider>
<name>#PROVIDER</name>
</entityProvider>
<entityField>
<name>UID</name>
</entityField>
<entityField>
<name>CHILD_ROLE</name>
</entityField>
<entityField>
<name>PARENT_ROLE</name>
</entityField>
<entityConsumer>
<name>Roles</name>
<dependency>
<name>dependency</name>
<entityName>Role_entity</entityName>
<fieldName>Roles</fieldName>
</dependency>
</entityConsumer>
<entityProvider>
<name>RoleParents</name>
<recordContainer>jDito</recordContainer>
<dependencies>
<entityDependency>
<name>6aa59dd4-1193-47be-8b69-58c82a0d9daa</name>
<entityName>Role_entity</entityName>
<fieldName>RoleParents</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies>
</entityProvider>
<entityParameter>
<name>RoleId_param</name>
<expose v="true" />
</entityParameter>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
<name>jDito</name>
<jDitoRecordAlias>_____SYSTEMALIAS</jDitoRecordAlias>
<contentProcess>%aditoprj%/entity/RoleParent_entity/recordcontainers/jdito/contentProcess.js</contentProcess>
<recordFieldMappings>
<jDitoRecordFieldMapping>
<name>UID.value</name>
</jDitoRecordFieldMapping>
<jDitoRecordFieldMapping>
<name>CHILD_ROLE.value</name>
</jDitoRecordFieldMapping>
<jDitoRecordFieldMapping>
<name>PARENT_ROLE.value</name>
</jDitoRecordFieldMapping>
</recordFieldMappings>
</jDitoRecordContainer>
</recordContainers>
</entity>
import("Sql_lib");
import("system.db");
import("system.vars");
import("system.result");
import("system.util");
var alias = SqlUtils.getSystemAlias();
var selectedRoleName = vars.exists("$param.RoleId_param") && vars.get("$param.RoleId_param");
var parents = [];
var parentRoles = newSelect("ID, PARENT_ROLE", alias)
.from("ASYS_ROLES_CHILDREN")
.where("ASYS_ROLES_CHILDREN.CHILD_ROLE", selectedRoleName)
.table();
for each (let parentRole in parentRoles) {
parents.push([parentRole[0], selectedRoleName, parentRole[1]]);
}
var ids = vars.get("$local.idvalues");
if (ids != null) {
parents = parents.filter(function(child) {
for (let i = 0; i < ids.length; i++) {
if (child[0] == ids[i])
return true;
}
return false;
});
}
result.object(parents);
\ No newline at end of file
......@@ -83,6 +83,12 @@
<fieldName>Roles</fieldName>
<isConsumer v="false" />
</entityDependency>
<entityDependency>
<name>23ceb9b3-429c-4381-9ae2-bd23d9d08d42</name>
<entityName>RoleParent_entity</entityName>
<fieldName>Roles</fieldName>
<isConsumer v="false" />
</entityDependency>
</dependencies>
<children>
<entityParameter>
......@@ -145,6 +151,20 @@
<onActionProcess>%aditoprj%/entity/Role_entity/entityfields/deleteeverythinglinkedtorole/onActionProcess.js</onActionProcess>
<iconId>VAADIN:CLOSE</iconId>
</entityActionField>
<entityConsumer>
<name>RoleParents</name>
<dependency>
<name>dependency</name>
<entityName>RoleParent_entity</entityName>
<fieldName>RoleParents</fieldName>
</dependency>
<children>
<entityParameter>
<name>RoleId_param</name>
<valueProcess>%aditoprj%/entity/Role_entity/entityfields/roleparents/children/roleid_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
......
import("system.result");
import("system.vars");
result.string(vars.get("$field.ROLENAME"));
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.1" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.1.1">
<name>RoleParent</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<entity>RoleParent_entity</entity>
<references>
<neonViewReference>
<name>41ee2c63-4408-4aba-bc22-75465fc94c47</name>
<view>RoleParentList_view</view>
</neonViewReference>
</references>
</neonContext>
<?xml version="1.0" encoding="UTF-8"?>
<neonView xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.4" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonView/1.1.4">
<name>RoleParentList_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<boxLayout>
<name>layout</name>
</boxLayout>
</layout>
<children>
<titledListViewTemplate>
<name>TitledList</name>
<entityField>#ENTITY</entityField>
<isDeletable v="false" />
<isEditable v="false" />
<isCreatable v="false" />
<columns>
<neonTitledListTableColumn>
<name>cdc83256-2ea4-4a97-a323-b400a4037915</name>
<entityField>PARENT_ROLE</entityField>
</neonTitledListTableColumn>
</columns>
</titledListViewTemplate>
</children>
</neonView>
......@@ -32,5 +32,10 @@
<entityField>RoleChildrens</entityField>
<view>RoleChildrenList_view</view>
</neonViewReference>
<neonViewReference>
<name>c13ad88f-679d-4cd5-a7ce-747d43ff7629</name>
<entityField>RoleParents</entityField>
<view>RoleParentList_view</view>
</neonViewReference>
</children>
</neonView>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment