diff --git a/entity/PermissionOverview_entity/recordcontainers/jdito/contentProcess.js b/entity/PermissionOverview_entity/recordcontainers/jdito/contentProcess.js index 2c418c0fb630dbf1d8b4981a72b61279ed8919a1..6bea9cea97e971c3ce1f4df662421f36c23aa9d7 100644 --- a/entity/PermissionOverview_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/PermissionOverview_entity/recordcontainers/jdito/contentProcess.js @@ -9,7 +9,6 @@ var roleTitle = ""; var entityTitle = ""; var sqlCond = ""; var sqlStr = ""; -var roleInternalEveryone = "INTERNAL_EVERYONE"; var entitiesMetaData = project.getDataModels(project.DATAMODEL_KIND_ENTITY); var entitiesUsePermFlagSet = []; // array, which contains ids of entities with usePermission flag set @@ -18,11 +17,6 @@ var entitiesUsePermFlagSet = []; // array, which contains ids of entities with u for each (let entityMetaData in entitiesMetaData) { 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, edit, delete - var noAccessPermissionSetIdEntity = PermissionUtil.insertNewPermissionSet("", entityMetaData[0], roleInternalEveryone, "", "E"); - PermissionUtil.insertNewPermission(noAccessPermissionSetIdEntity, "", "false"); // false is an indicator for PermissionDetails so the user can create a new PermissionSet on access level "E" - } } } diff --git a/process/autostartNeon/process.js b/process/autostartNeon/process.js index aa471725ace0af79aa8fb9b6eddbb99a2be34281..24001259d3d1c426dcb14a5bebcfe93183bb1d54 100644 --- a/process/autostartNeon/process.js +++ b/process/autostartNeon/process.js @@ -1,3 +1,5 @@ +import("Permission_lib"); +import("system.project"); import("system.logging"); import("system.tools"); import("system.calendars") @@ -15,3 +17,20 @@ for(var i = 0; i < usersTools.length; i++) calendars.setCalendarUser(users, calendars.RIGHT_READ | calendars.RIGHT_WRITE, false, calendars.SORTSTRATEGY_NATURAL); calendars.setCheckAttendeesOnWrite(false); + +// permissions - creating default permission (with no actions) for role everyone +var entitiesMetaData = project.getDataModels(project.DATAMODEL_KIND_ENTITY); +var entitiesUsePermFlagSet = []; // array, which contains ids of entities with usePermission flag set +var roleInternalEveryone = "INTERNAL_EVERYONE"; + +// gets all names of the entites which have the 'usePermission'-flag set (positive list) +for each (let entityMetaData in entitiesMetaData) { + 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, edit, delete + var noAccessPermissionSetIdEntity = PermissionUtil.insertNewPermissionSet("", entityMetaData[0], roleInternalEveryone, "", "E"); + PermissionUtil.insertNewPermission(noAccessPermissionSetIdEntity, "", "false"); // false is an indicator for PermissionDetails so the user can create a new PermissionSet on access level "E" + } + } +}