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

Permissions - Vorbelegung beim Erstellen von Berechtigungen

parent 43bbf94b
No related branches found
No related tags found
No related merge requests found
Showing with 66 additions and 10 deletions
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
<entityField> <entityField>
<name>CONDITION</name> <name>CONDITION</name>
<title>Condition</title> <title>Condition</title>
<stateProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/condition/stateProcess.js</stateProcess>
</entityField> </entityField>
<entityField> <entityField>
<name>ACTION</name> <name>ACTION</name>
...@@ -24,9 +25,10 @@ ...@@ -24,9 +25,10 @@
<name>ROLE</name> <name>ROLE</name>
<title>Role</title> <title>Role</title>
<consumer>Roles</consumer> <consumer>Roles</consumer>
<groupable v="true" />
<linkedContext>Role</linkedContext> <linkedContext>Role</linkedContext>
<mandatory v="true" /> <mandatory v="true" />
<groupable v="true" /> <stateProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/role/stateProcess.js</stateProcess>
<valueProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/role/valueProcess.js</valueProcess> <valueProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/role/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/role/displayValueProcess.js</displayValueProcess> <displayValueProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/role/displayValueProcess.js</displayValueProcess>
</entityField> </entityField>
...@@ -34,17 +36,19 @@ ...@@ -34,17 +36,19 @@
<name>ENTITY</name> <name>ENTITY</name>
<title>Entity</title> <title>Entity</title>
<consumer>MetaData</consumer> <consumer>MetaData</consumer>
<groupable v="true" />
<linkedContext>PermissionMetaData</linkedContext> <linkedContext>PermissionMetaData</linkedContext>
<mandatory v="true" /> <mandatory v="true" />
<groupable v="true" /> <stateProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/entity/stateProcess.js</stateProcess>
<valueProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/entity/valueProcess.js</valueProcess> <valueProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/entity/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/entity/displayValueProcess.js</displayValueProcess> <displayValueProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/entity/displayValueProcess.js</displayValueProcess>
</entityField> </entityField>
<entityField> <entityField>
<name>FIELD</name> <name>FIELD</name>
<title>Field</title> <title>Field</title>
<dropDownProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/field/dropDownProcess.js</dropDownProcess>
<groupable v="true" /> <groupable v="true" />
<dropDownProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/field/dropDownProcess.js</dropDownProcess>
<stateProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/field/stateProcess.js</stateProcess>
</entityField> </entityField>
<entityField> <entityField>
<name>UID</name> <name>UID</name>
...@@ -57,8 +61,9 @@ ...@@ -57,8 +61,9 @@
<name>ACCESSTYPE</name> <name>ACCESSTYPE</name>
<title>Access type</title> <title>Access type</title>
<consumer>KeywordAccessType</consumer> <consumer>KeywordAccessType</consumer>
<mandatory v="true" />
<groupable v="true" /> <groupable v="true" />
<mandatory v="true" />
<state>READONLY</state>
<valueProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/accesstype/valueProcess.js</valueProcess> <valueProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/accesstype/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/accesstype/displayValueProcess.js</displayValueProcess> <displayValueProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/accesstype/displayValueProcess.js</displayValueProcess>
</entityField> </entityField>
...@@ -67,6 +72,8 @@ ...@@ -67,6 +72,8 @@
<title>Condition Type</title> <title>Condition Type</title>
<consumer>KeywordConditionType</consumer> <consumer>KeywordConditionType</consumer>
<mandatory v="true" /> <mandatory v="true" />
<state>READONLY</state>
<valueProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/condtype/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/condtype/displayValueProcess.js</displayValueProcess> <displayValueProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/condtype/displayValueProcess.js</displayValueProcess>
</entityField> </entityField>
<entityField> <entityField>
......
import("system.logging");
import("system.vars"); import("system.vars");
import("system.result"); import("system.result");
import("Permission_lib"); import("Permission_lib");
...@@ -5,14 +6,18 @@ import("Permission_lib"); ...@@ -5,14 +6,18 @@ import("Permission_lib");
var field = vars.get("$field.FIELD"); var field = vars.get("$field.FIELD");
var role = vars.get("$field.ROLE"); var role = vars.get("$field.ROLE");
var entity = vars.get("$field.ENTITY"); var entity = vars.get("$field.ENTITY");
var permId = vars.get("$field.UID");
var rootPermSet = PermissionUtil.getRootPermissionSet(role, entity); var rootPermSet = PermissionUtil.getRootPermissionSet(role, entity);
var rootPerm = PermissionUtil.getDefaultPermission(rootPermSet);
if (rootPermSet == "") { if (rootPermSet == "") {
result.string("E"); result.string("E");
} else if (rootPerm == permId) {
result.string("E");
} else { } else {
result.string("R"); result.string("R");
} }
if (field != undefined && field != null && field != "") { if (field != undefined && field != null && field != "") {
result.string("F"); result.string("F");
} }
\ No newline at end of file
import("system.vars");
import("system.result");
import("system.neon");
if(vars.get("$field.ACCESSTYPE") == "E") {
result.string(neon.COMPONENTSTATE_DISABLED);
} else {
result.string(neon.COMPONENTSTATE_AUTO);
}
\ No newline at end of file
import("system.result");
result.string("true");
\ No newline at end of file
import("system.result");
import("system.vars");
import("system.neon");
var entityTitle = vars.get("$param.EntityTitle_param");
if (entityTitle != undefined && entityTitle != null && entityTitle != "") {
result.string(neon.COMPONENTSTATE_READONLY);
} else {
result.string(neon.COMPONENTSTATE_AUTO);
}
\ No newline at end of file
...@@ -3,7 +3,7 @@ import("system.result"); ...@@ -3,7 +3,7 @@ import("system.result");
import("system.vars"); import("system.vars");
import("system.project"); import("system.project");
var entityTitle = vars.get("$param.EntityTitle_param"); var entityTitle = vars.get("$field.ENTITY");
if (entityTitle != undefined && entityTitle != null && entityTitle != "") { if (entityTitle != undefined && entityTitle != null && entityTitle != "") {
var entityStructure = project.getEntityStructure(entityTitle); var entityStructure = project.getEntityStructure(entityTitle);
var res = []; var res = [];
......
import("system.result");
import("system.neon");
import("system.vars");
import("Permission_lib");
var role = vars.get("$field.ROLE");
var entity = vars.get("$field.ENTITY");
rootPermSet = PermissionUtil.getRootPermissionSet(role, entity);
if (rootPermSet == "") {
result.string(neon.COMPONENTSTATE_DISABLED);
} else {
result.string(neon.COMPONENTSTATE_EDITABLE);
}
\ No newline at end of file
import("system.result");
import("system.vars");
import("system.neon");
var roleTitle = vars.get("$param.RoleTitle_param");
if (roleTitle != undefined && roleTitle != null && roleTitle != "") {
result.string(neon.COMPONENTSTATE_READONLY);
} else {
result.string(neon.COMPONENTSTATE_AUTO);
}
\ No newline at end of file
...@@ -19,10 +19,6 @@ ...@@ -19,10 +19,6 @@
<editMode v="true" /> <editMode v="true" />
<entityField>#ENTITY</entityField> <entityField>#ENTITY</entityField>
<fields> <fields>
<entityFieldLink>
<name>7aa0ce6f-370c-4f50-8498-fd5768e0859c</name>
<entityField>CONDTYPE</entityField>
</entityFieldLink>
<entityFieldLink> <entityFieldLink>
<name>dd33df7a-82e6-49a8-b35f-99d0187970e3</name> <name>dd33df7a-82e6-49a8-b35f-99d0187970e3</name>
<entityField>CONDITION</entityField> <entityField>CONDITION</entityField>
......
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