zooniverse / front-end-monorepo

A rebuild of the front-end for zooniverse.org
https://www.zooniverse.org
Apache License 2.0
104 stars 29 forks source link

User can access workflow above assigned level #2991

Closed mcbouslog closed 2 years ago

mcbouslog commented 2 years ago

Package

Describe the bug

On a project with workflow assignment a user can access a workflow above their assigned level.

To Reproduce

Steps to reproduce the behavior:

  1. Signed out, Go to https://frontend.preview.zooniverse.org/projects/srallen086/workflow-assignment-testing/classify/workflow/2619?demo=true&env=staging

Expected behavior

A signed out user should be prompted with the workflow assignment modal, with only the Beginner workflow accessible.

mcbouslog commented 2 years ago

I think defining the workflowID here per the workflowFromUrl (which has been filtered based on if a user can access per workflow assignment) will fix the issue, I'll open a PR accordingly asap.

eatyourgreens commented 2 years ago

This line assumes you have access to all project workflows, by default. https://github.com/zooniverse/front-end-monorepo/blob/3e363a4a899f0e1fe0942274d4e6232e906df91d/packages/app-project/src/screens/ClassifyPage/ClassifyPageContainer.js#L19

eatyourgreens commented 2 years ago

@mcbouslog be careful not to regress the bug fixed by https://github.com/zooniverse/front-end-monorepo/pull/2465.