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");
var actionTitle = vars.get("$field.ACTION");
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");
neon.refresh();
\ No newline at end of file
neon.refresh(["$field.FIELD"]);
\ No newline at end of file
......@@ -32,7 +32,7 @@ for each (let row in insertedRows) {
}
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)) {
......
......@@ -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) {
var rootPermission = "";
......@@ -162,7 +162,7 @@ function sortActions(actions, accesstype) {
}
// 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")
return 0;
else if (a[6] == "E")
......@@ -186,7 +186,7 @@ function sortResultsAfterAccessTypes(a, b) {
}
// 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\":[]}}";
if (a[4] == "" || a[4] == noCond) {
return -1;
......
......@@ -52,5 +52,4 @@ if (PermissionUtil.setIsEmpty(parentPermSetId)) {
db.deleteData("ASYS_PERMISSIONSET", sqlCondDelPermSet, alias); // delete empty permissionset
}
neon.refreshAll();
tools.clearPermissionCache();
\ No newline at end of file
......@@ -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, permCondType, "CONDTYPE", "ASYS_PERMISSION"); // updates CONDTYPE if the new condtype is different to CONDTYPE in DB
neon.refreshAll();
tools.clearPermissionCache();
\ No newline at end of file
......@@ -3,9 +3,9 @@
<name>PermissionDetailPreview_view</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<layout>
<noneLayout>
<headerFooterLayout>
<name>layout</name>
</noneLayout>
</headerFooterLayout>
</layout>
<children>
<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