class BranchManagementPresenter extends Section<ProjectScreenModel> {

    @Override
    public Promise<Void> save(final String comment,
                              final Supplier<Promise<Void>> chain) {
        return promises.all(branchPermissionsByBranch.entrySet().stream().map(entry -> promises.promisify(libraryService, service -> {
            service.saveBranchPermissions(libraryPlaces.getActiveSpace().getName(),
                                          libraryPlaces.getActiveWorkspace().getRepository().getIdentifier(),
                                          entry.getKey(),
                                          entry.getValue());
        })).toArray(Promise[]::new));
    }

    @Inject public  BranchManagementPresenter(final View view,
                                     final Promises promises,
                                     final MenuItem<ProjectScreenModel> menuItem,
                                     final Event<SettingsSectionChange<ProjectScreenModel>> settingsSectionChangeEvent,
                                     final Caller<LibraryService> libraryService,
                                     final LibraryPlaces libraryPlaces,
                                     final RoleAccessListPresenter roleAccessListPresenter,
                                     final ProjectController projectController);

}