diff --git a/entity/PermissionOverview_entity/recordcontainers/jdito/contentProcess.js b/entity/PermissionOverview_entity/recordcontainers/jdito/contentProcess.js index 36adb5c827780dce7dae65303feb51769ea217a9..3046fae22e66262330c329219d0062d0497a6051 100644 --- a/entity/PermissionOverview_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/PermissionOverview_entity/recordcontainers/jdito/contentProcess.js @@ -46,36 +46,18 @@ rolesOrEntities = rolesOrEntitiesSelect var entityPermSetId = ""; for each (var element in rolesOrEntities) -{ // entry contains either a role or an entity, depending on which param exists - var overviewElement; - if (roleName) - { - overviewElement = { - uid: util.getNewUUID(), - entity: element, - role: roleName, - view: PermissionEnums.FORBIDDEN_ACTION_ICON(), - create: PermissionEnums.FORBIDDEN_ACTION_ICON(), - read: PermissionEnums.FORBIDDEN_ACTION_ICON(), - update: PermissionEnums.FORBIDDEN_ACTION_ICON(), - "delete": PermissionEnums.FORBIDDEN_ACTION_ICON(), - parent: null - }; - } - else if (entityName) - { - overviewElement = { - uid: util.getNewUUID(), - entity: entityName, - role: element, - view: PermissionEnums.FORBIDDEN_ACTION_ICON(), - create: PermissionEnums.FORBIDDEN_ACTION_ICON(), - read: PermissionEnums.FORBIDDEN_ACTION_ICON(), - update: PermissionEnums.FORBIDDEN_ACTION_ICON(), - "delete": PermissionEnums.FORBIDDEN_ACTION_ICON(), - parent: null - }; - } +{ + var overviewElement = { + uid: util.getNewUUID(), + entity: entityName ? entityName : element, + role: roleName ? roleName : element, + view: PermissionEnums.FORBIDDEN_ACTION_ICON(), + create: PermissionEnums.FORBIDDEN_ACTION_ICON(), + read: PermissionEnums.FORBIDDEN_ACTION_ICON(), + update: PermissionEnums.FORBIDDEN_ACTION_ICON(), + "delete": PermissionEnums.FORBIDDEN_ACTION_ICON(), + parent: null + }; entityPermSetId = PermissionUtil.getSetRoot(overviewElement.role, overviewElement.entity); @@ -117,10 +99,14 @@ if (roleName && roleName.startsWith("CUSTOM_")) update: PermissionEnums.FORBIDDEN_ACTION_ICON(), "delete": PermissionEnums.FORBIDDEN_ACTION_ICON(), parent: null - }; + }; - overviewElement = prepareOverviewElement(set.setid, overviewElement); - overview = mergeElementIntoOverviewByEntity(overview, overviewElement); + // don't add this element if the entity is not in the list of entities with usePermission set + if (entitiesUsePermFlagSet.indexOf(overviewElement.entity) != -1) + { + overviewElement = prepareOverviewElement(set.setid, overviewElement); + overview = mergeElementIntoOverviewByEntity(overview, overviewElement); + } } }