use of net.nemerosa.ontrack.model.structure.ID in project ontrack by nemerosa.
the class ProjectEntityExtensionController method getInformation.
/**
* Gets the list of information extensions for an entity
*/
@RequestMapping(value = "information/{entityType}/{id}", method = RequestMethod.GET)
public Resources<EntityInformation> getInformation(@PathVariable ProjectEntityType entityType, @PathVariable ID id) {
// Gets the entity
ProjectEntity entity = getEntity(entityType, id);
// List of informations to return
List<EntityInformation> informations = extensionManager.getExtensions(EntityInformationExtension.class).stream().map(x -> x.getInformation(entity)).filter(Optional::isPresent).map(Optional::get).collect(Collectors.toList());
// OK
return Resources.of(informations, uri(MvcUriComponentsBuilder.on(getClass()).getInformation(entityType, id)));
}
use of net.nemerosa.ontrack.model.structure.ID in project ontrack by nemerosa.
the class AccountServiceIT method admin_can_delete_promotion_run.
/**
* Regression test for #427
*/
@Test
public void admin_can_delete_promotion_run() throws Exception {
// Creates an account
ID id = account().getId();
// Assigns the Administrator role to this account
asUser().with(AccountManagement.class).call(() -> accountService.saveGlobalPermission(PermissionTargetType.ACCOUNT, id.get(), new PermissionInput("ADMINISTRATOR")));
// Gets the ACL of the account
Account account = asUser().with(AccountManagement.class).call(() -> accountService.withACL(AuthenticatedAccount.of(accountService.getAccount(id))));
// Creates any project
Project project = doCreateProject();
// Checks the account can delete a promotion run
assertTrue("An administrator must be granted the promotion run deletion", account.isGranted(project.id(), PromotionRunDelete.class));
}
Aggregations