Page MenuHomePhabricator

Access Collection button on partner pages should be greyed out if the user hasn't agreed to the terms of use
Closed, ResolvedPublic

Description

When a user hasn't agreed to the site terms of use, the 'Access Collection' links on the My Library page are greyed out and noninteractive:

image.png (1,848×815 px, 263 KB)

Users can also find an 'Access Collection' button on the individual partner pages. Even if they haven't agreed to the terms of use, this button always works:

image.png (1,890×715 px, 117 KB)

We should instead be greying this button out too. We currently only do so if the user isn't bundle eligible (https://github.com/WikipediaLibrary/TWLight/blob/master/TWLight/resources/templates/resources/partner_detail.html#L479).

Acceptance criteria

  • A user who hasn't agreed to the terms of use shouldn't be able to access a Bundle collection via the Access Collection button on the partner detail pages.

Event Timeline

I wonder if wp_bundle_eligible should be False if the user hasn't agreed to the terms of use, but I'm not sure that's easily implementable since we only update wp_bundle_eligible on login and via the cron. I don't think we should spend that much time on this.

ThesenatorO5-2 subscribed.

I suggest protecting this task as a sec issue, since this may lead to people exploiting this problem and use your services without agreeing to the terms.
I am claiming this task and will find out a solution since I am running MWVagrant.

I don't think this rises to a level of needing to be security protected.

I am claiming this task and will find out a solution since I am running MWVagrant.

MWVagrant won't help you here unfortunately - the Library Card platform is a tool hosted on Cloud VPS. See https://github.com/wikipedialibrary/twlight for information on how to set this tool up :)

I have got that, in the progress of being built.

Anyway. I claimed the task, and I will do my best in fixing this.

Thanks! Let me know if you have any questions.

We discussed checking terms agreement in all code that works with user auths. The idea is that if the user hasn't agree to terms, the platform should behave as if the user had no auths and display a warning message indicating that they need to agree to terms.

My recollection is that this should just impact a few views, and maybe email tasks and/or management commands.
We also discussed that terms agreement should be a part of the bundle eligibility check.

Thanks for offering to take this task @ThesenatorO5-2. Since this is time sensitive we're going to pick it up and get things finished here.

I recommend taking a look at the tasks flagged with good first task at https://phabricator.wikimedia.org/project/board/2765/query/rCNFr9ipmEnt/ if you'd like to find something else to work on!

I have removed the good first task tag to avoid further confusion. Thanks for pointing that out!