Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix publicly shared annotations #6784

Merged
merged 3 commits into from
Jan 26, 2023
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
- Fixed a bug where direct task assignment to a single user would fail. [#6777](https://github.com/scalableminds/webknossos/pull/6777)
- Fixed a bug where the dataset folders view would not list public datasets if the requesting user could not also access the dataset for other reasons, like being admin. [#6759](https://github.com/scalableminds/webknossos/pull/6759)
- Fixed a bug where zarr-streamed datasets would produce (very rare) rendering errors. [#6782](https://github.com/scalableminds/webknossos/pull/6782)
- Fixed a bug where publicly shared annotations were not viewable by users without an account. [#6784](https://github.com/scalableminds/webknossos/pull/6784)

### Removed

Expand Down
10 changes: 7 additions & 3 deletions frontend/javascripts/components/secured_route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { PageUnavailableForYourPlanView } from "components/pricing_enforcers";
import type { ComponentType } from "react";
import type { RouteComponentProps } from "react-router-dom";
import type { OxalisState } from "oxalis/store";
import { enforceActiveOrganization } from "oxalis/model/accessors/organization_accessors";

type StateProps = {
activeOrganization: APIOrganization | null;
Expand Down Expand Up @@ -69,10 +68,15 @@ class SecuredRoute extends React.PureComponent<SecuredRouteProps, State> {
return <LoginView redirect={this.props.location.pathname} />;
}

const organization = enforceActiveOrganization(this.props.activeOrganization);
if (
this.props.requiredPricingPlan &&
!isPricingPlanGreaterEqualThan(organization.pricingPlan, this.props.requiredPricingPlan)
!(
this.props.activeOrganization &&
isPricingPlanGreaterEqualThan(
this.props.activeOrganization.pricingPlan,
this.props.requiredPricingPlan,
)
)
) {
return <PageUnavailableForYourPlanView />;
}
Expand Down