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

feat: backend approach for access control options #300

Closed
wants to merge 10,000 commits into from

Conversation

mariajgrimaldi
Copy link
Member

@mariajgrimaldi mariajgrimaldi commented Dec 15, 2023

Description

This PR adds new fields to the sequence metadata so a client can use it to control a student's access:

  "metadata":
       {
           …
           "is_access_controlled": true,
           "access_control_type": "password",
           "access_control_allowed_values": "1234,1235"
       },

Which view to be rendered would depend on access_control_type, which can be password, IP range, or Secure Web Browser.

Here's an outline of the technical proposal: https://docs.google.com/document/d/16qIS1LDl-STp0WJZk4swUb2y7ShFZE0Lec7iZiTwVFo

Supporting information

More context on the product proposal can be found here: https://openedx.atlassian.net/wiki/spaces/COMM/pages/3928293395/New+ways+of+restricting+access+to+subsections

Testing instructions

  1. Move to this branch
  2. Run: tutor dev exec lms shell && ./manage lms migrate learning_sequences
  3. Make a POST call to save your sequence metadata with the new fields we just added:
    POST <STUDIO_URL>/xblock/<USAGE_KEY>
    Here's an example:
    image
  4. You can get the sequence metadata by calling:
    GET <STUDIO_URL>/xblock/<USAGE_KEY> with the header Accept: application/json
    image

Cup0fCoffee and others added 30 commits October 16, 2023 21:15
Learners want to have the usual course navigation when viewing a wiki,
so that they can go back to the course related to the wiki and browse
other tabs/sections of the course.

Wiki reads the course from the `request.course`. If it's not present,
i.e.  None or not set on the request, it will not show the course
navigation UI.

It seems like `WikiAccessMiddleware` already has the code that parses
course id from the request (when the request is for a wiki view) and
sets the course for the request. However, it doesn't work in most
scenarios, because the course id is not in the it's normal format in
most requests that go to wiki.

For example, when a leaner clicks on a wiki tab from the course
overview, they are redirected to `/wiki/<wiki_slug>/` path. The wiki
slug is taken from course's `wiki_slug` field. This slug can be used to
figure out what course this wiki belongs to in most (not all) cases.

This commit adds code to the `WikiAccessMiddleware` that attempts to
find a course based on wiki slug, and in case of success, sets the
course to the `request.course`, so that wiki can display course
navigation UI.
…ed-roles-studio-fix

Fix studio for users with derived roles and some other related changes [BB-7834]
Limited Staff should not have studio read access by design.

However, since many LMS views depend on the `has_course_author_access` check and `course_author_access_required`
decorator, we have to allow write access until the permissions become more granular. For example, there should
be STUDIO_VIEW_COHORTS and STUDIO_EDIT_COHORTS specifically for the cohorts endpoint, which is used to display
"Cohorts" instructor dashboard tab.
Update JWT Cookie vs Session user monitoring

Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`

Co-authored-by: robrap <[email protected]>
Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`
…dx-enterprise-52302e3

feat: Upgrade Python dependency edx-enterprise
…length_default

feat: Update the minimum password length.
enterprise version bump

Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`
…e-edx-enterprise-7202c22

feat: Upgrade Python dependency edx-enterprise
* chore: replace pyjwkest with pyjwt
linting, fixing pr comment
Removing unused import
fix: restored badges handlers

feat: remove FE code for badges

fix: resolved failing tests

fix: removed test case for badges app

fix: unused import error

fix: Response Field Count

fix: shareable account response length

fix: resolved PR comments

fix: revert settings override

feat!: Removed Badges App

fix: restored badges handlers

feat: remove FE code for badges

fix: resolved failing tests

fix: removed test case for badges app

fix: unused import error

fix: Response Field Count

fix: shareable account response length

fix: revert subscription badge
…nedx#33535)

I get a weekly CI failure email due to this scheduled workflow running on
my fork of edx-platform. Cancelling the job when it runs on a fork prevents
this.
…31893)

feat: Account and profile MFE legacy removal - redeployment

* Revert "Revert "FC-0001: Account pages -> micro-frontend (openedx#30336)" (openedx#31888)"

This reverts commit 90c4ca6.

* refactor: removed filters test from user_api accounts

---------

Co-authored-by: Bilal Qamar <[email protected]>
…ns/aws-actions/configure-aws-credentials-2

build(deps): bump aws-actions/configure-aws-credentials from 1 to 2
Currently, ./xmodule/ unit tests are only run with LMS settings. However,
./common/ and ./xmodule/ are run twice: once with LMS settings and once with
CMS settings.

Just like ./common/ and ./openedx/, the unit tests in ./xmodule/ validate
behavior in both LMS and CMS. So, order to fully test ./xmodule/, we should to
run its tests with CMS settings too.

This will enable us to better validate certain LibraryContentBlocks behaviors
being touched by openedx#33263 which can't
be expressed under LMS settings.

Also in this commit:

* refactor: rename the shards to be clear whether they're running under LMS or CMS
* docs: correct comments regarding conditions under which codejail's
   test_cant_do_something_forbidden is skipped.
* test: update a unit test which was using the now-deleted library_sourced block to use
   library_content block instead.
…ve-coaching-functionality-from-edx-platform

feat: remove deprecated coaching from edx-platform
yusuf-musleh and others added 27 commits November 29, 2023 10:10
fix: hide feedback widget by default
Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`
feat: integrated resumeCourseRunUrl into enrollments API

Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`
…edx-enterprise-54b351c

feat: Upgrade Python dependency edx-enterprise
* chore: updating constraint description.
* chore: removing docutils constraint.
…penedx#33860)

After refactoring the library_content block to use asynchronous tasks
for syncing and duplicating children, we are seeing an error arise
during library_content duplication process on edx.org:

Traceback (most recent call last):
  File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/content_libraries/tasks.py", line 305, in duplicate_children
    _copy_overrides(store=store, user_id=user_id, source_block=source_block, dest_block=dest_block)
  File "/edx/app/edxapp/edx-platform/openedx/core/djangoapps/content_libraries/tasks.py", line 383, in _copy_overrides
    dest_block=dest_block.runtime.get_block(dest_child_key),
  File "/edx/app/edxapp/edx-platform/xmodule/x_module.py", line 1401, in get_block
    block = self.load_item(usage_id, for_parent=for_parent)
  File "/edx/app/edxapp/edx-platform/xmodule/modulestore/split_mongo/caching_descriptor_system.py", line 127, in _load_item
    block_data = self.get_module_data(block_key, course_key)
  File "/edx/app/edxapp/edx-platform/xmodule/modulestore/split_mongo/caching_descriptor_system.py", line 154, in get_module_data
    raise ItemNotFoundError(block_key)
xmodule.modulestore.exceptions.ItemNotFoundError: BlockKey(...)

We cannot reproduce the issue locally.
We are not entirely certain the cause of this, but we think it might
have do with caching. Specifically, the `store.get_item` and
`source_block.runtime.get_block` methods might use a different cache
than `dest_block.runtime.get_block`. It's possible that writes to
Mongo are sitting in one of those caches, causing reads from the
`dest_block.runtime`'s cache to fail to find dest_block's children.

We attempt to fix this by using the same "block getting" method
consistently. So instead of using a mix of `store.get_item`,
`source_block.runtime.get_block`, and `dest_block.runtime.get_block`,
we just use `store.get_item` everywhere.
* chore: upgrade boto.
This switch has been kept disabled in edx.org for well over a year with no
trouble, and the migration to `CLOSEST_CLIENT_IP_FROM_HEADERS`
was introduced in Nutmeg.

DEPR issue: openedx#33733
…penedx#33724)

(requires the contentstore.enable_copy_paste_units waffle flag)
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@v3...v4)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
adds log for learner data transmission run

Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`
…x-enterprise-abfc61e

feat: Upgrade Python dependency edx-enterprise
fix: fixed the domain issue to point to "courses.edx.org" for the resumeCourseRunUrl

Commit generated by workflow `openedx/edx-platform/.github/workflows/upgrade-one-python-dependency.yml@refs/heads/master`
…edx-enterprise-f9b6e45

feat: Upgrade Python dependency edx-enterprise
This PR: openedx#32282 introduced some duplications of existing functions and classes by accident. I am cleaning them up here:
- `StudioPermissionsService` class
- `duplicate_block function`
- `load_services_for_studio` function
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.