-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: component asset api views (#35765)
Uses drf view to authenticate user before allowing them to access library static assets.
- Loading branch information
1 parent
db587bd
commit ca7da37
Showing
4 changed files
with
33 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -168,12 +168,12 @@ def test_anonymous_user(self): | |
response = self.client.get( | ||
f"/library_assets/component_versions/{self.draft_component_version.uuid}/static/test.svg" | ||
) | ||
assert response.status_code == 403 | ||
assert response.status_code == 401 | ||
|
||
def test_unauthorized_user(self): | ||
"""User who is not a Content Library staff should not have access.""" | ||
self.client.logout() | ||
student = UserFactory.create( | ||
UserFactory.create( | ||
username="student", | ||
email="[email protected]", | ||
password="student-pass", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters