-
Notifications
You must be signed in to change notification settings - Fork 192
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
Private redirecting link for support from a Studio Admin #4914
Comments
Hey @rtibbles @MisRob @AlexVelezLl , can you assign this issue to me please? |
Sure thing! Please feel free to ask any questions or clarifications here! |
Hey @rtibbles, Here's an update on the progress of this task.
Currently im trying to test the endpoints I have defined, However i'm not sure how to setup the authentication in postman. Would you have an idea on how I could go about this? I tried basic auth with the following credentials I have raised a draft PR, it would be great if you could have a look at it and let me know if i'm going in the right direction. |
Hi @adibmbrk, I believe you connected with Richard already on Slack about this, right? |
Yes! @MisRob Thanks for asking |
Hi @rtibbles! Thanks for having a look at my draft PR. Just a quick update on this task:
|
Hrm, I'm not seeing anything obvious why this would be a problem. One thing you do need to do is to create a Django migration for the model change though:
and commit the resulting file. Clearly that's not a problem in your local testing though, so I don't think that's the root of the issue. But doing this would let me see the test run on the PR and look at the code locally potentially. |
The test run is now available on the PR @rtibbles, and the issue seems to be reproducible on the PR builder as well. I'll try a couple of different approaches as well to see if I could solve this issue. |
Oh - one thought, I don't think you've logged the client in as your test user! Can use this method of the client See how we do that in our test base class: https://github.com/learningequality/studio/blob/unstable/contentcuration/contentcuration/tests/base.py#L40 |
Hey @rtibbles, I traced the issue to the Since the backend is done now, I will progress onto implementing the frontend. |
@adibmbrk Can I work on you with this? I am new to open Source contribution and I am not able to independently work on issues |
Great, thanks @adibmbrk - glad that helped unblock. What was the issue with the @is_admin decorator (I am interested because if that's not working it might be affecting other things too!) @devv2632 I think @adibmbrk has got this covered, thanks for your interest. You're welcome to find an unassigned 'help wanted' issue instead. There aren't many available issues right now so it's best to wait and keep an eye on the list. We label new ones on a weekly basis. I'd also invite you to have a look at the contributing guidelines (CONTRIBUTING.md) if you haven't seen them yet. Thank you. |
Desired behavior
Within the channel edit view, under the top right dropdown menu:
We can navigate into "Share channel".
Within this page:
A new section should be added above "Invite collaborators".
This will display either the link for the support link in the same style (disabled text box and copy button) as the channel token sharing:
Or, if no link yet exists, a button to generate a link.
This link will include a specially generated token that is not otherwise displayed to the user, and does not allow for channel import, and the link will only properly redirect for Studio administrators.
Technical implementation
A new
support_token
ForeignKey field should be added to the ChannelModel. This should be nullable and have no default. It should foreign key to the same SecretToken model that is used for this field: https://github.com/learningequality/studio/blob/unstable/contentcuration/contentcuration/models.py#L798 but as it is distinct, it will not be able to be used for channel import look ups.To support the redirect, a new view should be created that has permissions restricted to admin only, and then looks up the token in the URL. It should then redirect to the channel edit page for the channel associated with the support token. If the token does not exist, or the token is a valid token but not a support token, then it should return a 404.
To support the frontend functionality, a new detail endpoint on the main channel viewset should be created for fetching the support token. Additionally, the endpoint should support creation of a token, but only if a token does not already exist. Attempts to create a token when one already exists should return a 409 error code.
In the frontend, loading the token and creating the token can happen using direct interaction with the API endpoints, and do not need to happen via the indexedDB layer/sync endpoint.
The text was updated successfully, but these errors were encountered: