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

fix: fetch org list only for course creator granted status and course admin can create new library #588

Merged

Conversation

kaustavb12
Copy link
Member

@kaustavb12 kaustavb12 commented Sep 19, 2023

Description

This PR fixes two bugs :

  1. fetch org list only for course creator granted status:
    The get_organizations is used to fetch a list of orgs which a user is allowed to create courses/libraries for. The course creator status for the user is used here to determine which orgs to display to the user.

However, currently all orgs are fetched for users even with course creator status in unrequested or pending state. This is a bug which is being fixed with this PR.

  1. Course instrutors cannot create new library even though course staff can:
    Currently course staff has the ability to create new libraries for their respective orgs. But when a course staff user is "promoted" to course instructor/admin role, the user loses this ability. This bug is fixed with the PR too.

Supporting information

Link to other information about the change, such as Jira issues, GitHub issues, or Discourse discussions.
Be sure to check they are publicly readable, or if not, repeat the information here.

Testing instructions

fetch org list only for course creator granted status:

  1. In devstack, set ENABLE_ORGANIZATION_STAFF_ACCESS_FOR_CONTENT_LIBRARIES feature flag in Studio to False.
  2. Create a new user and give that user course staff access for any course.
  3. Login to studio as the new user and click on New Library button on the studio homepage
  4. Click on the org dropdown and verify no orgs are fetched.

Course instrutors cannot create new library even though course staff can:

  1. In devstack, create a new user and give that user course staff access for any course
  2. Login to studio as the new user and verify the New Library button is visible on the studio homepage.
  3. As an admin user, promote the new user to coures instructor/admin role
  4. Login to studio as the new user and verify that the New Library button is still visible on the studio homepage.

Deadline

"None" if there's no rush, or provide a specific date or event (and reason) if there is one.

Other information

BB-7827

@kaustavb12 kaustavb12 force-pushed the kaustav/show_library_button_only_if_orgs branch 2 times, most recently from f292234 to 73b159f Compare September 19, 2023 09:34
@kaustavb12 kaustavb12 changed the title fix: fetch org list only for course creator granted status fix: fetch org list only for course creator granted status and course admin can create new library Sep 19, 2023
Copy link
Member

@navinkarkera navinkarkera left a comment

Choose a reason for hiding this comment

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

👍

  • I tested this: (used the sandbox for testing)
  • I read through the code
  • I checked for accessibility issues
  • Includes documentation
  • I made sure any change in configuration variables is reflected in the corresponding client's configuration-secure repository.

@kaustavb12 kaustavb12 force-pushed the kaustav/show_library_button_only_if_orgs branch from 602f0d1 to 93a5d94 Compare September 20, 2023 11:28
@kaustavb12 kaustavb12 merged commit 4b52e99 into opencraft-release/palm.1 Sep 20, 2023
41 checks passed
@kaustavb12 kaustavb12 deleted the kaustav/show_library_button_only_if_orgs branch September 20, 2023 12:21
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.

2 participants