.setUpdatedAt(now));
insertGroupPermission(dbSession, permissionTemplateDto, ADMIN, ownerGroup);
- insertGroupPermission(dbSession, permissionTemplateDto, ISSUE_ADMIN, ownerGroup);
- insertGroupPermission(dbSession, permissionTemplateDto, SECURITYHOTSPOT_ADMIN, ownerGroup);
insertGroupPermission(dbSession, permissionTemplateDto, SCAN.getKey(), ownerGroup);
insertGroupPermission(dbSession, permissionTemplateDto, USER, defaultGroup);
insertGroupPermission(dbSession, permissionTemplateDto, CODEVIEWER, defaultGroup);
+ insertGroupPermission(dbSession, permissionTemplateDto, ISSUE_ADMIN, defaultGroup);
+ insertGroupPermission(dbSession, permissionTemplateDto, SECURITYHOTSPOT_ADMIN, defaultGroup);
dbClient.organizationDao().setDefaultTemplates(
dbSession,
.setUpdatedAt(dateNow));
insertProjectCreatorPermission(dbSession, permissionTemplateDto, ADMIN, now);
- insertProjectCreatorPermission(dbSession, permissionTemplateDto, ISSUE_ADMIN, now);
- insertProjectCreatorPermission(dbSession, permissionTemplateDto, SECURITYHOTSPOT_ADMIN, now);
insertProjectCreatorPermission(dbSession, permissionTemplateDto, SCAN.getKey(), now);
insertGroupPermission(dbSession, permissionTemplateDto, USER, defaultGroup);
insertGroupPermission(dbSession, permissionTemplateDto, CODEVIEWER, defaultGroup);
+ insertGroupPermission(dbSession, permissionTemplateDto, ISSUE_ADMIN, defaultGroup);
+ insertGroupPermission(dbSession, permissionTemplateDto, SECURITYHOTSPOT_ADMIN, defaultGroup);
dbClient.organizationDao().setDefaultTemplates(
dbSession,
assertThat(dbClient.permissionTemplateDao().selectGroupPermissionsByTemplateId(dbSession, defaultTemplate.getId()))
.extracting(PermissionTemplateGroupDto::getGroupId, PermissionTemplateGroupDto::getPermission)
.containsOnly(
- tuple(ownersGroup.getId(), UserRole.ADMIN), tuple(ownersGroup.getId(), UserRole.ISSUE_ADMIN), tuple(ownersGroup.getId(), UserRole.SECURITYHOTSPOT_ADMIN),
+ tuple(ownersGroup.getId(), UserRole.ADMIN),
tuple(ownersGroup.getId(), GlobalPermissions.SCAN_EXECUTION),
- tuple(defaultGroupId, UserRole.USER), tuple(defaultGroupId, UserRole.CODEVIEWER));
+ tuple(defaultGroupId, UserRole.USER),
+ tuple(defaultGroupId, UserRole.CODEVIEWER),
+ tuple(defaultGroupId, UserRole.ISSUE_ADMIN),
+ tuple(defaultGroupId, UserRole.SECURITYHOTSPOT_ADMIN));
}
@Test
assertThat(dbClient.permissionTemplateDao().selectGroupPermissionsByTemplateId(dbSession, defaultTemplate.getId()))
.extracting(PermissionTemplateGroupDto::getGroupId, PermissionTemplateGroupDto::getPermission)
.containsOnly(
- tuple(defaultGroupId, UserRole.USER), tuple(defaultGroupId, UserRole.CODEVIEWER));
+ tuple(defaultGroupId, UserRole.USER),
+ tuple(defaultGroupId, UserRole.CODEVIEWER),
+ tuple(defaultGroupId, UserRole.ISSUE_ADMIN),
+ tuple(defaultGroupId, UserRole.SECURITYHOTSPOT_ADMIN));
assertThat(dbClient.permissionTemplateCharacteristicDao().selectByTemplateIds(dbSession, Collections.singletonList(defaultTemplate.getId())))
.extracting(PermissionTemplateCharacteristicDto::getWithProjectCreator, PermissionTemplateCharacteristicDto::getPermission)
.containsOnly(
- tuple(true, UserRole.ADMIN), tuple(true, UserRole.ISSUE_ADMIN), tuple(true, UserRole.SECURITYHOTSPOT_ADMIN), tuple(true, GlobalPermissions.SCAN_EXECUTION));
+ tuple(true, UserRole.ADMIN),
+ tuple(true, GlobalPermissions.SCAN_EXECUTION));
}
@Test
assertThat(dbClient.permissionTemplateDao().selectGroupPermissionsByTemplateId(dbSession, defaultTemplate.getId()))
.extracting(PermissionTemplateGroupDto::getGroupId, PermissionTemplateGroupDto::getPermission)
.containsOnly(
- tuple(ownersGroup.getId(), UserRole.ADMIN), tuple(ownersGroup.getId(), UserRole.ISSUE_ADMIN), tuple(ownersGroup.getId(), UserRole.SECURITYHOTSPOT_ADMIN),
+ tuple(ownersGroup.getId(), UserRole.ADMIN),
tuple(ownersGroup.getId(), GlobalPermissions.SCAN_EXECUTION),
- tuple(defaultGroup.getId(), UserRole.USER), tuple(defaultGroup.getId(), UserRole.CODEVIEWER));
+ tuple(defaultGroup.getId(), UserRole.USER),
+ tuple(defaultGroup.getId(), UserRole.CODEVIEWER),
+ tuple(defaultGroup.getId(), UserRole.ISSUE_ADMIN),
+ tuple(defaultGroup.getId(), UserRole.SECURITYHOTSPOT_ADMIN));
}
@Test