diff --git a/cms/envs/common.py b/cms/envs/common.py index 8d496c2b27..69f08d9bf3 100644 --- a/cms/envs/common.py +++ b/cms/envs/common.py @@ -450,7 +450,6 @@ LOGIN_URL = reverse_lazy('login_redirect_to_lms') AUTHENTICATION_BACKENDS = [ 'rules.permissions.ObjectPermissionBackend', 'openedx.core.djangoapps.oauth_dispatch.dot_overrides.backends.EdxRateLimitedAllowAllUsersModelBackend', - 'bridgekeeper.backends.RulePermissionBackend', ] STATIC_ROOT_BASE = '/edx/var/edxapp/staticfiles' @@ -1313,7 +1312,6 @@ INSTALLED_APPS = [ # rule-based authorization 'rules.apps.AutodiscoverRulesConfig', - 'bridgekeeper', # management of user-triggered async tasks (course import/export, etc.) 'user_tasks', diff --git a/lms/djangoapps/courseware/permissions.py b/lms/djangoapps/courseware/permissions.py deleted file mode 100644 index 38de7b8855..0000000000 --- a/lms/djangoapps/courseware/permissions.py +++ /dev/null @@ -1,8 +0,0 @@ -""" -Permission definitions for the courseware djangoapp -""" - -from bridgekeeper import perms -from .rules import HasAccessRule - -perms['courseware.view_course_home'] = HasAccessRule('load') diff --git a/lms/djangoapps/courseware/rules.py b/lms/djangoapps/courseware/rules.py index eac41bb97a..2dcb72c049 100644 --- a/lms/djangoapps/courseware/rules.py +++ b/lms/djangoapps/courseware/rules.py @@ -1,15 +1,12 @@ """ -django-rules and Bridgekeeper rules for courseware related features +django-rules for courseware related features """ from __future__ import absolute_import -from bridgekeeper.rules import Rule from course_modes.models import CourseMode from opaque_keys.edx.keys import CourseKey from student.models import CourseEnrollment -from .access import has_access - import rules @@ -27,17 +24,3 @@ def is_track_ok_for_exam(user, exam): # proctored experience can_take_proctored_exam = is_track_ok_for_exam rules.set_perm('edx_proctoring.can_take_proctored_exam', is_track_ok_for_exam) - - -class HasAccessRule(Rule): - """ - A rule that calls `has_access` to determine whether it passes - """ - def __init__(self, action): - self.action = action - - def check(self, user, instance=None): - return has_access(user, self.action, instance) - - def query(self, user): - raise NotImplementedError() diff --git a/lms/djangoapps/courseware/views/views.py b/lms/djangoapps/courseware/views/views.py index 53725655ef..23675ba5e5 100644 --- a/lms/djangoapps/courseware/views/views.py +++ b/lms/djangoapps/courseware/views/views.py @@ -810,7 +810,7 @@ def course_about(request, course_id): staff_access = bool(has_access(request.user, 'staff', course)) studio_url = get_studio_url(course, 'settings/details') - if request.user.has_perm('courseware.view_course_home', course): + if has_access(request.user, 'load', course): course_target = reverse(course_home_url_name(course.id), args=[text_type(course.id)]) else: course_target = reverse('about_course', args=[text_type(course.id)]) diff --git a/lms/envs/common.py b/lms/envs/common.py index 98f3b0f8a9..f4ad12ca8b 100644 --- a/lms/envs/common.py +++ b/lms/envs/common.py @@ -749,8 +749,7 @@ derived_collection_entry('DEFAULT_TEMPLATE_ENGINE', 'DIRS') AUTHENTICATION_BACKENDS = [ 'rules.permissions.ObjectPermissionBackend', - 'openedx.core.djangoapps.oauth_dispatch.dot_overrides.backends.EdxRateLimitedAllowAllUsersModelBackend', - 'bridgekeeper.backends.RulePermissionBackend', + 'openedx.core.djangoapps.oauth_dispatch.dot_overrides.backends.EdxRateLimitedAllowAllUsersModelBackend' ] STUDENT_FILEUPLOAD_MAX_SIZE = 4 * 1000 * 1000 # 4 MB @@ -2481,7 +2480,6 @@ INSTALLED_APPS = [ # rule-based authorization 'rules.apps.AutodiscoverRulesConfig', - 'bridgekeeper', # Customized celery tasks, including persisting failed tasks so they can # be retried diff --git a/requirements/edx/base.txt b/requirements/edx/base.txt index 4f3e9f7508..86d193fb57 100644 --- a/requirements/edx/base.txt +++ b/requirements/edx/base.txt @@ -35,7 +35,6 @@ bleach==2.1.4 boto3==1.4.8 boto==2.39.0 botocore==1.8.17 -git+https://github.com/edx/bridgekeeper.git@4e34894e4ac5d0467ed1901811a81fd87ee01937#egg=bridgekeeper==0.0 git+https://github.com/edx/openedx-calc.git@e9b698c85ad1152002bc0868f475f153dce88952#egg=calc==0.4 celery==3.1.25 certifi==2019.6.16 diff --git a/requirements/edx/development.txt b/requirements/edx/development.txt index d808476462..22ad41be3b 100644 --- a/requirements/edx/development.txt +++ b/requirements/edx/development.txt @@ -43,7 +43,6 @@ bok-choy==1.0.0 boto3==1.4.8 boto==2.39.0 botocore==1.8.17 -git+https://github.com/edx/bridgekeeper.git@4e34894e4ac5d0467ed1901811a81fd87ee01937#egg=bridgekeeper==0.0 git+https://github.com/edx/openedx-calc.git@e9b698c85ad1152002bc0868f475f153dce88952#egg=calc==0.4 caniusepython3==7.1.0 celery==3.1.25 diff --git a/requirements/edx/github.in b/requirements/edx/github.in index fa39772337..7f20755908 100644 --- a/requirements/edx/github.in +++ b/requirements/edx/github.in @@ -74,11 +74,6 @@ git+https://github.com/edx/django-rest-framework-oauth.git@0a43e8525f1e3048efe4b # This dependency will be removed by the Celery 4 upgrade: https://openedx.atlassian.net/browse/PLAT-1684 git+https://github.com/edx/django-celery.git@756cb57aad765cb2b0d37372c1855b8f5f37e6b0#egg=django-celery==3.2.1+edx.2 -# Forked to add support for python2.7 and to fix predicate inversion -# Once https://github.com/excitedleigh/bridgekeeper/pull/10 is merged, and we get to python3 and django 2, we can -# remove this fork -git+https://github.com/edx/bridgekeeper.git@4e34894e4ac5d0467ed1901811a81fd87ee01937#egg=bridgekeeper==0.0 - # Our libraries: -e git+https://github.com/edx/codejail.git@a320d43ce6b9c93b17636b2491f724d9e433be47#egg=codejail -e git+https://github.com/edx/acid-block.git@e46f9cda8a03e121a00c7e347084d142d22ebfb7#egg=acid-xblock diff --git a/requirements/edx/testing.txt b/requirements/edx/testing.txt index 7cbc29fb37..f1407036cf 100644 --- a/requirements/edx/testing.txt +++ b/requirements/edx/testing.txt @@ -41,7 +41,6 @@ bok-choy==1.0.0 boto3==1.4.8 boto==2.39.0 botocore==1.8.17 -git+https://github.com/edx/bridgekeeper.git@4e34894e4ac5d0467ed1901811a81fd87ee01937#egg=bridgekeeper==0.0 git+https://github.com/edx/openedx-calc.git@e9b698c85ad1152002bc0868f475f153dce88952#egg=calc==0.4 caniusepython3==7.1.0 celery==3.1.25