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

API: Update Broadcast round - set period not work #15395

Closed
SergioGlorias opened this issue May 29, 2024 · 4 comments
Closed

API: Update Broadcast round - set period not work #15395

SergioGlorias opened this issue May 29, 2024 · 4 comments

Comments

@SergioGlorias
Copy link
Contributor

Exact URL of where the bug happened

API: https://lichess.org/broadcast/round/{broadcastRoundId}/edit

Steps to reproduce the bug

  1. have StudyAdmin permission
  2. create a broadcast with at least 1 round
  3. try editing via API defined period

What did you expect to happen?

period should be defined

What happened instead?

the data is empty

Operating system

Chrome OS (but it was also tested on windows)

Browser and version (or alternate access method)

Python, N8N, Javascript

Additional information

No response

@tors42
Copy link
Contributor

tors42 commented May 30, 2024

Most likely mod scope missing on token

@kraktus kraktus removed the bug label Jun 1, 2024
@kraktus
Copy link
Member

kraktus commented Jun 2, 2024

still happening?

@tors42
Copy link
Contributor

tors42 commented Jun 3, 2024

It seems to me that it is possible to update the period value via API.

The user account needs to be a Study/Broadcast Admin,
and the token that the user account uses to access the API needs to have the scopes web:mod, study:write and study:read (possibly ok without study:read)

Here's an example which creates a broadcast round with a period (42s),
and then updates the round with a new period (20s),
https://gist.github.com/tors42/49b74ee441a767f9e7e7bfc528fe8085

@ornicar ornicar closed this as completed Jun 4, 2024
@SergioGlorias
Copy link
Contributor Author

SergioGlorias commented Jun 4, 2024

As expected, a Studyadmin does not have access to web:mod
(to create a token)

@ornicar The period that is necessary for broadcasters

val hidden =
scope == OAuthScope.Web.Mod && !(
Granter.opt(_.Shusher) || Granter.opt(_.BoostHunter) || Granter.opt(_.CheatHunter)
)

@ornicar ornicar reopened this Jun 5, 2024
@ornicar ornicar closed this as completed in d1bbd2b Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants