PermissionUtil.insertPermission(noAccessPermissionSetIdEntity,"",0);// 0 is an indicator for PermissionDetails so the user can create a new PermissionSet on access level "E"
varentitiesUsePermFlagSet=[];// array, which contains ids of entities with usePermission flag set
varroleInternalEveryone="INTERNAL_EVERYONE";
// gets all names of the entites which have the 'usePermission'-flag set (positive list)
foreach (letentityMetaDatainentitiesMetaData){// TODO: replace "for each (.. in ..)" with for (.. of ..) when the designer supports it (the server already supports it). As it's deprecated in js https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Statements/for_each...in
if (entityMetaData[6]=="true"){
entitiesUsePermFlagSet.push(entityMetaData[0])
if (PermissionUtil.getNumberOfPermissions(entityMetaData[0])==0){
// no permissions found for the given entity -> create permissionset for role INTERNAL_EVERYONE with five X's for view, create, read, update, delete
PermissionUtil.insertPermission(noAccessPermissionSetIdEntity,"",0);// 0 is an indicator for PermissionDetails so the user can create a new PermissionSet on access level "E"