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

Adding an IsInstructor Function into src/privileges/users.js #80

Closed
wants to merge 14 commits into from

Conversation

emshyu
Copy link

@emshyu emshyu commented Oct 11, 2024

The main components of this pull request are an IsInstructor function to check if a user is considered an instructor and test cases for it in test/user.js. This is intended for the highlighting/flagging instructor posts feature.

However, although the frontend (it has visible design changes) and backend are working separately, we are still running into issues with calling the function in posts.tpl and topics_list.tpl. We also went to office hours for TA help and were unable to call the function successfully in the frontend.

Context:
Before choosing this, I experimented with various options of tracking if a user is an instructor including adding an isInstructor attribute to user in the database, adding fields to postData, and making functions in src/posts/data.js and src/posts/user.js.

I eventually decided to try making a function in user privileges because I saw that frontend template files could successfully call privileges.isAdminOrMod, which checks if the signed-in user is an administrator or moderator. Hopefully, with more experimentation, we can call the function successfully.

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.

1 participant