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

Permissions - bugs caused by neon.refresh fixed + refactoring

parent d2f324ee
No related branches found
No related tags found
No related merge requests found
...@@ -5,5 +5,5 @@ import("system.result"); ...@@ -5,5 +5,5 @@ import("system.result");
var actionTitle = vars.get("$field.ACTION"); var actionTitle = vars.get("$field.ACTION");
if (actionTitle == "null" || actionTitle == undefined || actionTitle == null || actionTitle == "") { if (actionTitle == "null" || actionTitle == undefined || actionTitle == null || actionTitle == "") {
result.string(translate.text("Empty actions are not allowed!")); result.string(translate.text("Empty actions are invalid!"));
} }
\ No newline at end of file
import("system.neon"); import("system.neon");
neon.refresh(); neon.refresh(["$field.FIELD"]);
\ No newline at end of file \ No newline at end of file
...@@ -32,7 +32,7 @@ for each (let row in insertedRows) { ...@@ -32,7 +32,7 @@ for each (let row in insertedRows) {
} }
if (deletedRows.length == actionsAsStringArray.length && changedRows.length == 0 && insertedRows.length == 0) { if (deletedRows.length == actionsAsStringArray.length && changedRows.length == 0 && insertedRows.length == 0) {
result.string(translate.text("Permissions without actions are not allowed!")); result.string(translate.text("Permissions without actions are invalid!"));
} }
if (PermissionUtil.permissionExists(permId)) { if (PermissionUtil.permissionExists(permId)) {
......
...@@ -106,7 +106,7 @@ if (selectedPermission == null) { ...@@ -106,7 +106,7 @@ if (selectedPermission == null) {
} }
} }
result.object(res.sort(sortResultsAfterCondition).sort(sortResultsAfterAccessTypes)); result.object(res.sort(sortResultsByCondition).sort(sortResultsByAccessTypes));
function prepareResultArray(pEntry, pRes) { function prepareResultArray(pEntry, pRes) {
var rootPermission = ""; var rootPermission = "";
...@@ -162,7 +162,7 @@ function sortActions(actions, accesstype) { ...@@ -162,7 +162,7 @@ function sortActions(actions, accesstype) {
} }
// sorts result array: Entity -> Records -> Fields // sorts result array: Entity -> Records -> Fields
function sortResultsAfterAccessTypes(a, b) { function sortResultsByAccessTypes(a, b) {
if (a[6] == b[6] && a[6] != "F" && a[6] != "R") if (a[6] == b[6] && a[6] != "F" && a[6] != "R")
return 0; return 0;
else if (a[6] == "E") else if (a[6] == "E")
...@@ -186,7 +186,7 @@ function sortResultsAfterAccessTypes(a, b) { ...@@ -186,7 +186,7 @@ function sortResultsAfterAccessTypes(a, b) {
} }
// sorts result array: default permission -> conditional permission // sorts result array: default permission -> conditional permission
function sortResultsAfterCondition(a, b) { function sortResultsByCondition(a, b) {
var noCond = "{\"entity\":\"" + vars.get("$field.ENTITY") + "\",\"filter\":{\"type\":\"group\",\"operator\":\"AND\",\"childs\":[]}}"; var noCond = "{\"entity\":\"" + vars.get("$field.ENTITY") + "\",\"filter\":{\"type\":\"group\",\"operator\":\"AND\",\"childs\":[]}}";
if (a[4] == "" || a[4] == noCond) { if (a[4] == "" || a[4] == noCond) {
return -1; return -1;
......
...@@ -52,5 +52,4 @@ if (PermissionUtil.setIsEmpty(parentPermSetId)) { ...@@ -52,5 +52,4 @@ if (PermissionUtil.setIsEmpty(parentPermSetId)) {
db.deleteData("ASYS_PERMISSIONSET", sqlCondDelPermSet, alias); // delete empty permissionset db.deleteData("ASYS_PERMISSIONSET", sqlCondDelPermSet, alias); // delete empty permissionset
} }
neon.refreshAll();
tools.clearPermissionCache(); tools.clearPermissionCache();
\ No newline at end of file
...@@ -32,5 +32,4 @@ if (diff.length > 0) { ...@@ -32,5 +32,4 @@ if (diff.length > 0) {
PermissionUtil.updateIfDiff(permissionid, permCond, "COND", "ASYS_PERMISSION"); // updates COND if the new cond is different to COND in DB PermissionUtil.updateIfDiff(permissionid, permCond, "COND", "ASYS_PERMISSION"); // updates COND if the new cond is different to COND in DB
PermissionUtil.updateIfDiff(permissionid, permCondType, "CONDTYPE", "ASYS_PERMISSION"); // updates CONDTYPE if the new condtype is different to CONDTYPE in DB PermissionUtil.updateIfDiff(permissionid, permCondType, "CONDTYPE", "ASYS_PERMISSION"); // updates CONDTYPE if the new condtype is different to CONDTYPE in DB
neon.refreshAll();
tools.clearPermissionCache(); tools.clearPermissionCache();
\ No newline at end of file
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
<name>PermissionDetailPreview_view</name> <name>PermissionDetailPreview_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode> <majorModelMode>DISTRIBUTED</majorModelMode>
<layout> <layout>
<noneLayout> <headerFooterLayout>
<name>layout</name> <name>layout</name>
</noneLayout> </headerFooterLayout>
</layout> </layout>
<children> <children>
<cardViewTemplate> <cardViewTemplate>
......
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