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

Let third-party scripts know if the user is a moderator #3341

Closed
CharlesNepote opened this issue Apr 29, 2020 · 5 comments · Fixed by #9918
Closed

Let third-party scripts know if the user is a moderator #3341

CharlesNepote opened this issue Apr 29, 2020 · 5 comments · Fixed by #9918
Labels
3rd party contributions Contributions from 3rd party apps through the Product WRITE API 🔐 API auth The API requires auth in order to perform editing.There is a common mechanism & a Robotoff mechanism API READ All READ APIs include Product, Search… API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) ✨ Feature Features or enhancements to Open Food Facts server frontend HTML hunger games 🎯 P1 candidate P2 Power User Script ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it.

Comments

@CharlesNepote
Copy link
Member

CharlesNepote commented Apr 29, 2020

What

Proposed solution

I'm not sure about the best solution. It can be:

  1. a special HTML class or id; e.g.: current code <span id="user_id">charlesnepote</span> could be enhanced to <span id="user_id" class="moderator">charlesnepote</span>
  2. it can be an HTML class higher in the hierarchy, to let front end dev add special features; e.g.: <body class="moderator-user">; that way, for example, the page style could be modified to let the user knows he's using a moderator account
  3. the session cookie could integrate a moderator=true information (a bit more secure?)

I think solution 2 might be the most interesting.

Number of products impacted

The impact should be important, letting all moderators (more than 20-30 persons) to easily use Mass Update feature. For the moment, Mass Update feature in Power User Script is a bad hack only given to few people.

Note: as it's an important feature for third-party scripts, we should add unit tests to ensure it's working without regressions by the time.

Part of

@CharlesNepote CharlesNepote added ✨ Feature Features or enhancements to Open Food Facts server 3rd party contributions Contributions from 3rd party apps through the Product WRITE API frontend HTML labels Apr 29, 2020
@github-actions
Copy link
Contributor

Stale issue message

@github-actions github-actions bot closed this as completed Jul 7, 2020
@hangy hangy reopened this Jul 7, 2020
@teolemon teolemon added API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) API READ All READ APIs include Product, Search… 🔐 API auth The API requires auth in order to perform editing.There is a common mechanism & a Robotoff mechanism labels Oct 21, 2022
@teolemon
Copy link
Member

We now have an AUTH API

@M123-dev
Copy link
Member

M123-dev commented Oct 22, 2022

We now have an AUTH API

I was thinking about the same thing for producer accounts, I am not one but creating a user account in smoothie has no impact at all in the app

@teolemon
Copy link
Member

@raphael0202 has the same issue: "Is there an endpoint to check a user session cookie and know whether it's a moderator/admin?".

Copy link
Contributor

This issue has been open 90 days with no activity. Can you give it a little love by linking it to a parent issue, adding relevant labels and projets, creating a mockup if applicable, adding code pointers from https://github.com/openfoodfacts/openfoodfacts-server/blob/main/.github/labeler.yml, giving it a priority, editing the original issue to have a more comprehensive description… Thank you very much for your contribution to 🍊 Open Food Facts

@github-actions github-actions bot added the ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. label Feb 29, 2024
@teolemon teolemon linked a pull request Mar 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3rd party contributions Contributions from 3rd party apps through the Product WRITE API 🔐 API auth The API requires auth in order to perform editing.There is a common mechanism & a Robotoff mechanism API READ All READ APIs include Product, Search… API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) ✨ Feature Features or enhancements to Open Food Facts server frontend HTML hunger games 🎯 P1 candidate P2 Power User Script ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it.
Projects
Development

Successfully merging a pull request may close this issue.

4 participants