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

Permissions - extended onValidation to block null-actions

parent 2a18f7dd
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,9 @@ var actionTitle = vars.get("$field.ACTION");
var permissionId = vars.get("$param.PermissionId_param");
var permCondInput = vars.get("$param.PermissionCondition_param");
if (PermissionUtil.existsPermission(permissionId)) {
if (actionTitle == "null" || actionTitle == undefined || actionTitle == null || actionTitle == "") {
result.string(translate.text("Empty actions are not allowed!"));
} else if (PermissionUtil.existsPermission(permissionId)) {
// existing permission
// check if action is already in DB
var actionsInDb = PermissionUtil.getPermissionAction(permissionId);
......@@ -23,4 +25,6 @@ if (PermissionUtil.existsPermission(permissionId)) {
break;
}
}
} else {
result.string(true);
}
\ No newline at end of file
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