-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: override course api perm to give data researcher progress page …
…access
- Loading branch information
1 parent
7f6318c
commit 5b07eae
Showing
4 changed files
with
49 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
"""Mock bridgekeeper permission map""" | ||
|
||
|
||
perms = {} |
3 changes: 3 additions & 0 deletions
3
test_utils/edx_platform_mocks_shared/lms/djangoapps/course_home_api/permissions.py
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"""Mocked course api permissions""" | ||
|
||
CAN_MASQUARADE_LEARNER_PROGRESS = 'fake_name' |
30 changes: 30 additions & 0 deletions
30
test_utils/edx_platform_mocks_shared/lms/djangoapps/courseware/rules.py
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"""Mocked bridgekeepr lms rules""" | ||
|
||
|
||
class Rule: | ||
"""Mocked Base class for rules.""" | ||
def check(self, user, instance=None): | ||
"""Check if a user satisfies this rule.""" | ||
raise NotImplementedError() | ||
|
||
def __or__(self, other): | ||
return True | ||
|
||
|
||
class HasRolesRule(Rule): # pylint: disable=too-few-public-methods | ||
"""Mocked HasRolesRule""" | ||
def __init__(self, *roles): | ||
self.roles = roles | ||
|
||
def check(self, user=None, instance=None): | ||
return True | ||
|
||
|
||
class HasAccessRule(Rule): # pylint: disable=too-few-public-methods | ||
"""Mocked HasAccessRule""" | ||
|
||
def __init__(self, *roles): | ||
self.roles = roles | ||
|
||
def check(self, user=None, instance=None): | ||
return True |