Skip to content

Conversation

@somiaj
Copy link
Contributor

@somiaj somiaj commented Nov 8, 2025

First, this adds the permission webservice_render_problem used to determine if a user can render a problem with the WebworkWebservice, instead of using the proctor_quiz_login permission for this.

Second, this adds an additional permission webservice_render_source used to determine if a user can render problems using the problem provided with the request. The use case for this is to allow users which can render problems only using a problem filename, but not by providing the problem's source.

These permissions are both set to login_proctor to match current behavior and are provided to allow server admins to change which users can render problems. These permissions are not added to the course configuration page as they are permissions that should not be modified by most users, only server admins via localOverrides.conf or course.conf.

One way to test this is to set webservice_render_source to nobody, and see that pages like the library browser still work since rendering is done via filenames, but the problem editor no longer works.

@somiaj somiaj force-pushed the permission-render-source branch from 5edf777 to 1938199 Compare November 8, 2025 17:49
First, this adds the permission `webservice_render_problem`
used to determine if a user can render a problem with the
WebworkWebservice, instead of using the `proctor_quiz_login`
permission for this.

Second, this adds an additional permission `webservice_render_source`
used to determine if a user can render problems using the
problem provided with the request. The use case for this is to
allow users which can render problems only using a problem
filename, but not by providing the problem's source.

These permissions are both set to `login_proctor` to match
current behavior and are provided to allow server admins to
change which users can render problems. These permissions are
not added to the course configuration page as they are permissions
that should not be modified by most users, only server admins
via `localOverrides.conf` or `course.conf`.
@somiaj somiaj force-pushed the permission-render-source branch from 1938199 to 51d4a6f Compare November 8, 2025 17:50
@somiaj
Copy link
Contributor Author

somiaj commented Nov 8, 2025

Permission checked moved and updated using @drgrice1 suggested code.

@drgrice1
Copy link
Member

drgrice1 commented Nov 8, 2025

I am wondering if this is the right way to go at all. I think that rather than using permissions at all which is really tit-for-tat on the current setup, there should be a "white list" of users that are allowed to render problem source, but the "white list" only applies for the case that unsecured rpc usage is allowed and cookies are disabled for the request. The point is that this is even more specific than a permission, and that I think this is something that only should apply at all in the case that unsecured rpc usage is being utilized.

@somiaj
Copy link
Contributor Author

somiaj commented Nov 8, 2025

That could work, though I am unsure how to apply it to my use case. It appears that allow_unsecured_rpc is a server setting and not a course setting. In my setup, I have a single course with two users, my admin user and the login_proctor public user, which I have disabled two factor auth for. I don't see the need to setup a second webwork server for this, when at the moment I can just setup a single course for that.

Copy link
Member

@drgrice1 drgrice1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that separating the renderProblem permission from the proctor_quiz_login permission is good, and further separating the capability of rendering problem source into another permission is also good.

I think that even better security for the allow_unsecured_rpc setting would also be good to implement in the future. Although perhaps that is a bit silly since that is always going to be unsecured. At least in the PreTeXt case, there is a user whose credentials are entirely public that is allowed to run untrusted code. There probably is nothing that can really be done to protect that.

@Alex-Jordan
Copy link
Contributor

Alex-Jordan commented Nov 8, 2025 via email

@Alex-Jordan Alex-Jordan merged commit 6c06cb9 into openwebwork:develop Nov 11, 2025
2 checks passed
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

Successfully merging this pull request may close these issues.

3 participants