diff --git a/entity/PermissionDetail_entity/PermissionDetail_entity.aod b/entity/PermissionDetail_entity/PermissionDetail_entity.aod index f3d756e76599690d112ba3c1e6d0459155f53af1..74fc985e17acacdee7a2d607a52e24e541e39467 100644 --- a/entity/PermissionDetail_entity/PermissionDetail_entity.aod +++ b/entity/PermissionDetail_entity/PermissionDetail_entity.aod @@ -13,6 +13,7 @@ <entityField> <name>CONDITION</name> <title>Condition</title> + <stateProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/condition/stateProcess.js</stateProcess> </entityField> <entityField> <name>ACTION</name> @@ -24,9 +25,10 @@ <name>ROLE</name> <title>Role</title> <consumer>Roles</consumer> + <groupable v="true" /> <linkedContext>Role</linkedContext> <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> <displayValueProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/role/displayValueProcess.js</displayValueProcess> </entityField> @@ -34,17 +36,19 @@ <name>ENTITY</name> <title>Entity</title> <consumer>MetaData</consumer> + <groupable v="true" /> <linkedContext>PermissionMetaData</linkedContext> <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> <displayValueProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/entity/displayValueProcess.js</displayValueProcess> </entityField> <entityField> <name>FIELD</name> <title>Field</title> - <dropDownProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/field/dropDownProcess.js</dropDownProcess> <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> <name>UID</name> @@ -57,8 +61,9 @@ <name>ACCESSTYPE</name> <title>Access type</title> <consumer>KeywordAccessType</consumer> - <mandatory v="true" /> <groupable v="true" /> + <mandatory v="true" /> + <state>READONLY</state> <valueProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/accesstype/valueProcess.js</valueProcess> <displayValueProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/accesstype/displayValueProcess.js</displayValueProcess> </entityField> @@ -67,6 +72,8 @@ <title>Condition Type</title> <consumer>KeywordConditionType</consumer> <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> </entityField> <entityField> diff --git a/entity/PermissionDetail_entity/entityfields/accesstype/valueProcess.js b/entity/PermissionDetail_entity/entityfields/accesstype/valueProcess.js index c24340acec17af395c991dfafe87f1d3cd8cbc1c..a94ae37903173214ad3f6a3306c08a4a643e114e 100644 --- a/entity/PermissionDetail_entity/entityfields/accesstype/valueProcess.js +++ b/entity/PermissionDetail_entity/entityfields/accesstype/valueProcess.js @@ -1,3 +1,4 @@ +import("system.logging"); import("system.vars"); import("system.result"); import("Permission_lib"); @@ -5,14 +6,18 @@ import("Permission_lib"); var field = vars.get("$field.FIELD"); var role = vars.get("$field.ROLE"); var entity = vars.get("$field.ENTITY"); +var permId = vars.get("$field.UID"); var rootPermSet = PermissionUtil.getRootPermissionSet(role, entity); +var rootPerm = PermissionUtil.getDefaultPermission(rootPermSet); if (rootPermSet == "") { result.string("E"); +} else if (rootPerm == permId) { + result.string("E"); } else { result.string("R"); } if (field != undefined && field != null && field != "") { result.string("F"); -} \ No newline at end of file +} diff --git a/entity/PermissionDetail_entity/entityfields/condition/stateProcess.js b/entity/PermissionDetail_entity/entityfields/condition/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..f6b4510443313add8e02e610d18165a834e48bd1 --- /dev/null +++ b/entity/PermissionDetail_entity/entityfields/condition/stateProcess.js @@ -0,0 +1,9 @@ +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 diff --git a/entity/PermissionDetail_entity/entityfields/condtype/valueProcess.js b/entity/PermissionDetail_entity/entityfields/condtype/valueProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..ab53c1064a98c7ea344ba50a3466fba3e2ee683a --- /dev/null +++ b/entity/PermissionDetail_entity/entityfields/condtype/valueProcess.js @@ -0,0 +1,2 @@ +import("system.result"); +result.string("true"); \ No newline at end of file diff --git a/entity/PermissionDetail_entity/entityfields/entity/stateProcess.js b/entity/PermissionDetail_entity/entityfields/entity/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..943bb0881702bf7d6a70344f64c3d99834e6834b --- /dev/null +++ b/entity/PermissionDetail_entity/entityfields/entity/stateProcess.js @@ -0,0 +1,11 @@ +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 diff --git a/entity/PermissionDetail_entity/entityfields/field/dropDownProcess.js b/entity/PermissionDetail_entity/entityfields/field/dropDownProcess.js index a0b883d9d77ff2204b334abd237c16f007860367..224911373cb609e9b4430ba3c96584e5987f1fb1 100644 --- a/entity/PermissionDetail_entity/entityfields/field/dropDownProcess.js +++ b/entity/PermissionDetail_entity/entityfields/field/dropDownProcess.js @@ -3,7 +3,7 @@ import("system.result"); import("system.vars"); import("system.project"); -var entityTitle = vars.get("$param.EntityTitle_param"); +var entityTitle = vars.get("$field.ENTITY"); if (entityTitle != undefined && entityTitle != null && entityTitle != "") { var entityStructure = project.getEntityStructure(entityTitle); var res = []; diff --git a/entity/PermissionDetail_entity/entityfields/field/stateProcess.js b/entity/PermissionDetail_entity/entityfields/field/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..b6485674e6b472b05c3ff21dfc2d1279c1a10e93 --- /dev/null +++ b/entity/PermissionDetail_entity/entityfields/field/stateProcess.js @@ -0,0 +1,15 @@ +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 diff --git a/entity/PermissionDetail_entity/entityfields/role/stateProcess.js b/entity/PermissionDetail_entity/entityfields/role/stateProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..f5fec84a8c27d08002a0d7e50ab9aa4839078944 --- /dev/null +++ b/entity/PermissionDetail_entity/entityfields/role/stateProcess.js @@ -0,0 +1,11 @@ +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 diff --git a/neonView/PermissionDetailPreview_view/PermissionDetailPreview_view.aod b/neonView/PermissionDetailPreview_view/PermissionDetailPreview_view.aod index ca1524850be726abbc34d28b8cbaa207d6f9b5fa..e6db91d75ca21de791e1f8d3b2a297c8368e58f6 100644 --- a/neonView/PermissionDetailPreview_view/PermissionDetailPreview_view.aod +++ b/neonView/PermissionDetailPreview_view/PermissionDetailPreview_view.aod @@ -19,10 +19,6 @@ <editMode v="true" /> <entityField>#ENTITY</entityField> <fields> - <entityFieldLink> - <name>7aa0ce6f-370c-4f50-8498-fd5768e0859c</name> - <entityField>CONDTYPE</entityField> - </entityFieldLink> <entityFieldLink> <name>dd33df7a-82e6-49a8-b35f-99d0187970e3</name> <entityField>CONDITION</entityField>