Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api/src/org/labkey/api/reports/ReportService.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@

public interface ReportService
{
String R_REPORT_CUSTOM_SHARING = "rReportCustomSharing";

// this logger is to enable all report loggers in the admin ui (org.labkey.api.reports.*)
@SuppressWarnings({"UnusedDeclaration", "SSBasedInspection"})
Logger packageLogger = LogManager.getLogger(ReportService.class.getPackageName());
Expand Down
11 changes: 9 additions & 2 deletions api/src/org/labkey/api/reports/report/r/RReport.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.labkey.api.rstudio.RStudioService;
import org.labkey.api.security.SecurityManager;
import org.labkey.api.security.User;
import org.labkey.api.settings.OptionalFeatureService;
import org.labkey.api.thumbnail.Thumbnail;
import org.labkey.api.util.FileUtil;
import org.labkey.api.util.PageFlowUtil;
Expand Down Expand Up @@ -74,6 +75,8 @@
import java.util.Map;
import java.util.Set;

import static org.labkey.api.reports.ReportService.R_REPORT_CUSTOM_SHARING;

public class RReport extends ExternalScriptEngineReport
{
public static final String TYPE = "ReportService.rReport";
Expand Down Expand Up @@ -925,8 +928,12 @@ public String getEditAreaSyntax()
@Override
public boolean allowShareButton(User user, Container container)
{
// allow sharing if this R report is a DB report and the user canShare
return !getDescriptor().isModuleBased() && canShare(user, container);
if (OptionalFeatureService.get().isFeatureEnabled(R_REPORT_CUSTOM_SHARING))
{
// allow sharing if this R report is a DB report and the user canShare
return !getDescriptor().isModuleBased() && canShare(user, container);
}
return false;
}

public static class TestCase extends Assert
Expand Down
11 changes: 10 additions & 1 deletion query/src/org/labkey/query/QueryModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.labkey.api.data.TableInfo;
import org.labkey.api.data.views.DataViewService;
import org.labkey.api.exp.property.PropertyService;
import org.labkey.api.mcp.McpService;
import org.labkey.api.message.digest.DailyMessageDigest;
import org.labkey.api.message.digest.ReportAndDatasetChangeDigestProvider;
import org.labkey.api.migration.DatabaseMigrationService;
Expand All @@ -40,7 +41,6 @@
import org.labkey.api.module.DefaultModule;
import org.labkey.api.module.Module;
import org.labkey.api.module.ModuleContext;
import org.labkey.api.mcp.McpService;
import org.labkey.api.pipeline.PipelineService;
import org.labkey.api.query.DefaultSchema;
import org.labkey.api.query.JavaExportScriptFactory;
Expand Down Expand Up @@ -77,6 +77,7 @@
import org.labkey.api.security.roles.PlatformDeveloperRole;
import org.labkey.api.security.roles.Role;
import org.labkey.api.security.roles.RoleManager;
import org.labkey.api.settings.OptionalFeatureFlag;
import org.labkey.api.settings.OptionalFeatureService;
import org.labkey.api.stats.AnalyticsProviderRegistry;
import org.labkey.api.stats.SummaryStatisticRegistry;
Expand Down Expand Up @@ -145,6 +146,7 @@
import java.util.function.Supplier;

import static org.labkey.api.query.QueryService.USE_ROW_BY_ROW_UPDATE;
import static org.labkey.query.reports.ReportServiceImpl.R_REPORT_CUSTOM_SHARING;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggest importing via ReportService instead of ReportServiceImpl

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's weird it grabbed that import, Done.


public class QueryModule extends DefaultModule
{
Expand Down Expand Up @@ -346,6 +348,13 @@ public void doStartup(ModuleContext moduleContext)
Role trustedAnalystRole = RoleManager.getRole("org.labkey.api.security.roles.TrustedAnalystRole");
if (null != trustedAnalystRole)
trustedAnalystRole.addPermission(EditQueriesPermission.class);

OptionalFeatureService.get().addFeatureFlag(new OptionalFeatureFlag(R_REPORT_CUSTOM_SHARING,
"Restore custom R report sharing",
"Allows R reports to be shared on a per user basis. This option will be removed in LabKey Server 26.7.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this PR target 26.3 instead? If it goes to develop, it'll hit in 26.4 and ESR customers won't get any warning before its removal.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I had asked that question in standup and the response was 26.4, but you're right. I'll retarget this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Targeting 26.4 would likely be fine, but if that's where it first ships we should remove in 26.11 instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that it's a fairly trivial change seems fine to go to 26.3.

false,
false,
OptionalFeatureService.FeatureType.Deprecated));
}

@Override
Expand Down