public TermsOfServiceUserProfileExtension()

in termsOfService-server/src/main/java/jetbrains/buildServer/termsOfService/TermsOfServiceUserProfileExtension.java [26:60]


    public TermsOfServiceUserProfileExtension(@NotNull TermsOfServiceManager manager,
                                              @NotNull PagePlaces pagePlaces,
                                              @NotNull PluginDescriptor descriptor,
                                              @NotNull WebControllerManager webControllerManager) {
        webControllerManager.registerController(PATH, this);
        this.descriptor = descriptor;
        this.termsOfServiceManager = manager;

        SimpleCustomTab userProfileTab = new SimpleCustomTab(pagePlaces) {

            private final ThreadLocal<String> tabTitle = new ThreadLocal<>();

            @NotNull
            @Override
            public String getTabTitle() {
                String title = tabTitle.get();
                return title != null ? title : "Privacy";
            }

            @Override
            public boolean isAvailable(@NotNull HttpServletRequest request) {
                TermsOfServiceManager.Agreement agreement = getAgreementWithConsents(SessionUser.getUser(request));
                if (agreement != null) {
                    tabTitle.set(agreement.getShortName());
                    return true;
                }
                return false;
            }
        };

        userProfileTab.setPlaceId(PlaceId.MY_TOOLS_TABS);
        userProfileTab.setPluginName("TermsOfServicesUserConsents");
        userProfileTab.setIncludeUrl(PATH);
        userProfileTab.register();
    }