Skip to content

Authz validate/me requests are sent with course-scoped permissions before a course scope is available #3131

Description

@mariajgrimaldi

Description

When authz is enabled, Studio is sending validate/me requests for course-scoped permissions from pages where there is no course scope available yet.

For example, from Studio home, before opening a course outline, validate/me is being called for permissions that appear to be related to course outline actions, such as:

{
  "action": "courses.manage_advanced_settings"
}

However, this request is being sent from a generic Studio page where no course scope is attached yet. The request fails because the payload includes a permission that requires a scope, but the request does not include one:

{
  "scope": ["This field is required."]
}
Image Image

Steps to reproduce

  1. Enable authz.enable_course_authoring.
  2. Log in to Studio.
  3. Go to Studio home.
  4. Do not open any course yet.
  5. Open the browser dev tools.
  6. Check the network requests.
  7. Look for calls to validate/me.
  8. Review the request payload and response.

Expected behavior

Studio should only send course-scoped permission validation requests when the related course scope is available.

Permissions related to course outline or course-level actions should not be validated from (generic?) Studio pages before a course is loaded.

Actual behavior

Studio sends a validate/me request from Studio home for a course-scoped action. The request payload includes:

{
  "action": "courses.manage_advanced_settings"
}

The response returns a scope validation error:

{
  "scope": ["This field is required."]
}

Metadata

Metadata

Assignees

Labels

Type

Projects

Status
Backlog
Status
Ready for review

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions