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

Student admin #1063

Draft
wants to merge 44 commits into
base: development
Choose a base branch
from
Draft

Student admin #1063

wants to merge 44 commits into from

Conversation

qasema
Copy link
Collaborator

@qasema qasema commented Sep 1, 2023

Did: fixes #984 and added a new role called student Admin. Student admin should have the same privileges as program managers for all programs aside from Bonner.

Test:

  • Switch to branch studentAdmin
  • Reset the data to ensure the role in the database (test data).
  • In the bottom left corner switch the current user to Student Admin: bledsoef
  • Go through events, create, delete, and edit events. Make sure the user has access and can edit for events associated with all programs except for Bonner
  • Switch to user to Admin and go to settings and then user management. Try to add and remove a new student Admin to make sure it works as expected.
  • review code

Copy link
Contributor

@BrianRamsay BrianRamsay left a comment

Choose a reason for hiding this comment

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

Re-evaluate all of the boolean expressions you have added this to. So far all of them are wrong.

app/controllers/admin/routes.py Outdated Show resolved Hide resolved
app/controllers/admin/routes.py Outdated Show resolved Hide resolved
app/controllers/admin/routes.py Outdated Show resolved Hide resolved
app/controllers/admin/routes.py Outdated Show resolved Hide resolved
app/controllers/admin/routes.py Outdated Show resolved Hide resolved
@gahimbaref
Copy link
Contributor

The Student Admin doesn't have access to the edit page

image

@gahimbaref
Copy link
Contributor

When an admin creates a bonner event, a student admin has access to it when you switch roles
image

Copy link
Contributor

@AndersonStettner AndersonStettner left a comment

Choose a reason for hiding this comment

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

Need to create tests for new logic.

app/templates/main/userProfile.html Outdated Show resolved Hide resolved
@gahimbaref gahimbaref self-requested a review December 4, 2023 21:33
app/models/user.py Show resolved Hide resolved
<div class="col-md-6 mb-3">
<div>
{{createInputsButtons("searchCeltsAdminInput", "Add Celts Admin")}}<br>
{% if g.current_user.isCeltsAdmin and not g.current_user.isCeltsStudentAdmin %}
Copy link
Contributor

Choose a reason for hiding this comment

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

Everyone with isCeltsAdmin true will have isCeltsStudentAdmin false, right? So Anderson was right after all, that the second part is redundant.

@gahimbaref
Copy link
Contributor

image
double-check if search loads up students properly when adding a new student admin, it doesn't always load student names

@bledsoef bledsoef assigned bledsoef and azabeli and unassigned qasema and ojmakinde Mar 1, 2024
@azabeli azabeli removed their request for review March 1, 2024 17:39
else:
return Program.select().join(ProgramManager).where(ProgramManager.user==currentUser).order_by(Program.programName)



def getAllowedTemplates(currentUser):
"""Returns a list of all visible templates depending on who the current user is. If they are not an admin it should always be none."""
if currentUser.isCeltsAdmin:
if currentUser.isCeltsAdmin or currentUser.isCeltsStudentAdmin:
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this allow them to see Bonner events?

Copy link

View Code Coverage

@bledsoef bledsoef added the on hold More information is needed before this issue can be completed. label Mar 12, 2024
@bledsoef
Copy link
Contributor

Placing on hold because we need to reevaluate what permissions student admins should be able to have.

@bledsoef
Copy link
Contributor

#1181 creating spreadsheet here

@bledsoef
Copy link
Contributor

Spreadsheet has been created, still waiting to hear back from @BrianRamsay on whether not the permissions are correct so we can finalize this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
on hold More information is needed before this issue can be completed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a new Student Admin role
9 participants