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

[Projekt: Entwicklung - Neon][TicketNr.: 1048120][Löschen einer Rolle entfernt...

[Projekt: Entwicklung - Neon][TicketNr.: 1048120][Löschen einer Rolle entfernt nicht die zugehörigen Permissions]
parent 2a152c3d
No related branches found
No related tags found
No related merge requests found
......@@ -150,6 +150,7 @@
<title>delete linked permissions and hierarchies</title>
<onActionProcess>%aditoprj%/entity/Role_entity/entityfields/deleteeverythinglinkedtorole/onActionProcess.js</onActionProcess>
<iconId>VAADIN:CLOSE</iconId>
<stateProcess>%aditoprj%/entity/Role_entity/entityfields/deleteeverythinglinkedtorole/stateProcess.js</stateProcess>
</entityActionField>
<entityConsumer>
<name>RoleParents</name>
......
import("system.logging");
import("system.neon");
import("system.result");
import("system.vars");
import("Permission_lib");
// action enabled if role has permissions or is part of hierarchy
// if role is deletable -> disable action
var roleName = vars.get("$field.ROLENAME");
var roleType = vars.get("$field.ROLETYPE");
if (roleType == "CUSTOM") {
if (PermissionUtil.roleIsDeletable(roleName)) {
result.string(neon.COMPONENTSTATE_DISABLED);
} else {
result.string(neon.COMPONENTSTATE_EDITABLE);
}
} else {
result.string(neon.COMPONENTSTATE_INVISIBLE);
}
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