@Override public Collection<LoadedBranchTemplateDefinition> getTemplateDefinitions(Project project) { return branchTemplateRepository.getTemplateDefinitions().stream() .map(btd -> new LoadedBranchTemplateDefinition( structureService.getBranch(btd.getBranchId()), btd.getTemplateDefinition() )) .filter(lbtd -> (lbtd.getBranch().projectId() == project.id())) .collect(Collectors.toList()); }
protected Build doCreateBuild(Branch branch, NameDescription nameDescription, Signature signature) throws Exception { return asUser().with(branch.projectId(), BuildCreate.class).call(() -> structureService.newBuild( Build.of( branch, nameDescription, signature ) )); }
protected PromotionLevel doCreatePromotionLevel(Branch branch, NameDescription nameDescription) throws Exception { return asUser().with(branch.projectId(), PromotionLevelCreate.class).call(() -> structureService.newPromotionLevel( PromotionLevel.of( branch, nameDescription ) )); }
Branch branch = structureService.getBranch(branchId); securityService.checkProjectFunction(branch.projectId(), BuildCreate.class);