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

Support for custom permission levels not in the userRoles hash (replacement of #2629) #2660

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

drgrice1
Copy link
Member

This replaces #2629 and makes the changes requested for that pull request.

Currently an permission level that is not in the userRoles hash causes an exception to be thrown if the accounts manager is loaded. This shows "Unknown: n" (where n is the unknown level) in that case and no exception is thrown.

The requested change is that the maketext call in #2629 was not valid.

taniwallach and others added 2 commits January 17, 2025 10:56
the active %userRoles hash. Will prevent Accounts Manager from failing.
See openwebwork#2625
but when editing a user with such a value, will only allow choosing
a defined level.
Copy link
Contributor

@somiaj somiaj left a comment

Choose a reason for hiding this comment

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

Tested this and confirmed it fixes the issue.

For others who want to test, I manually updated my database and gave a user an invalid permission level to test:

update `COURSEID_permission` set permission=12 where user_id='USERID';

@drgrice1
Copy link
Member Author

If you want to test this without going into the database, just add a custom role in localOverrides.conf such as $userRoles{badRole} = 1. Then create a user with that role. Then remove the custom role from localOverrides.conf, and load the accounts manager page.

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