Package: edx-rbac
OverviewLibrary to help manage role based access controls for django services.See theGetting startedguide to setup
your development environment.See theHow To Guideto learn about the
fundamentals of edx-rbac and how to implement RBAC in your Django service.LicenseThe code in this repository is licensed under the AGPL 3.0 unless
otherwise noted.Please seeLICENSE.txtfor details.How To ContributeContributions are very welcome.Please readHow To Contributefor details.PR description template should be automatically applied if you are sending PR from github interface; otherwise you
can find it it atPULL_REQUEST_TEMPLATE.mdIssue report template should be automatically applied if you are sending it from github UI as well; otherwise you
can find it atISSUE_TEMPLATE.mdReporting Security IssuesPlease do not report security issues in public. Please emailsecurity@edx.org.Getting HelpHave a question about this repository, or about Open edX in general?  Please
refer to thislist of resourcesif you need any assistance.Change LogUnreleased[1.8.0]Switch fromedx-sphinx-themetosphinx-book-themesince the former is
deprecatedAdded support for Django 4.2[1.7.0]fix:utils.get_role_auth_claim_for_user()now preserves the order of (role, context) pairs
as returned by theget_assignment()function.[1.6.0] - 2022-01-19Drop support for Django<3.2Replacing ugettext with gettext to resolve RemovedInDjango40 error.Added Django40 Support[1.5.1] - 2021-11-01Replacing ugettext_lazy with gettext_lazy to resolve RemovedInDjango40Warning.[1.5.0] - 2021-07-07Added support for django 3.0, 3.1, 3.2[1.4.2] - 2021-03-22Modifiescreate_role_auth_claim_for_userto return a list ofunique(role:context) entries, so that the JWT does not become too large
to fit in cookies/headers.[1.4.1] - 2021-01-22Add aUserRoleAssignment.applies_to_allfield, because explicit is better than implicit.
See the ADR atdocs/decisions/0002-explicit-role-assignment-wildcard.rst.[1.4.0]Update PyPI token.[1.3.3] - 2020-10-02Removedpython_2_unicode_compatibledecorator.[1.3.2] - 2020-07-28PermissionRequiredForListingMixin.get_queryset()should allow falseybase_querysetproperties, like
an emptyQuerySetobject.  Adds tests to verify that this is the case.[1.3.1] - 2020-06-16Updateget_assignments()to guard against AnonymousUsers.Updatecontexts_accessible_from_database()to useget_assignments()instead of building a “custom” QuerySet.[1.3.0] - 2020-06-11Adds a PermissionRequiredForListingMixin that can be used in DRF ModelViewSets and supports a list action.
This should allow list actions to return all of the elements from a base_queryset that
the requesting user has access to, either via their JWT or DB-assigned roles.Adds/modifies utility functions that deal with permission-checking to support multiple roles and multiple contexts.[1.2.1] - 2020-05-08Exposes a newutils.feature_roles_from_jwt()function, which, given a decoded JWT,
will provide a mapping of feature roles to contexts/identifiers.Modifiesutils.user_has_access_via_database()to check for multiple database role assignments
for a given user and role name (i.e. uses afilter()instead of aget()).[1.2.0] - 2020-04-30Removed support for django 2.0 and 2.1Added Support for Python 3.8[1.1.3] - 2020-04-13Added check for AnonymousUser in user_has_access_via_database to prevent 500 errors.[1.1.2] - 2020-03-27Added support for Django 2.0, 2.1, and 2.2.[1.1.1] - 2020-03-02Fix bug in implicit role check when the same role has multiple contexts available.[1.1.0] - 2020-02-18UpdatePermissionRequiredMixinto pass through an object to rule predicates, ifself.get_permision_requiredexists and is callable[1.0.5] - 2019-12-18Updated requirements.[1.0.4] - 2019-12-17Updated utils for user with multiple contexts.[1.0.3] - 2019-09-12Use functools.wraps to prevent the decorator from swallowing the view name[1.0.2] - 2019-07-12store current request on thread local storage using crum.[1.0.1] - 2019-05-27edx-drf-extensions version upgrade.[1.0.0] - 2019-05-20Removedget_request_or_stubandget_decoded_jwt_from_requestfrom utils.py[0.2.1] - 2019-05-08edx-drf-extensions version upgrade.[0.2.0] - 2019-04-30Check for JWT presence in implicit permission.Refactor role retrieval to remove the dependency on django models for assigning roles.[0.1.11] - 2019-04-08Get JWT token from request.auth if it is not set on the cookie. This supports client credentials oauth2 flow.[0.1.10] - 2019-04-01Update context checks for implicit and explicit access for all resources access.[0.1.9] - 2019-04-01Adding support for checking context for implicit and explicit access.[0.1.8] - 2019-03-22Adding an additional argument for the permission_required decorator[0.1.7] - 2019-03-20Adding a mixin for authz permissions support.[0.1.6] - 2019-03-19Adding a decorator for authz permissions support.[0.1.5] - 2019-03-18Adding django admin support for models extending UserRoleAssignment.[0.1.4] - 2019-03-07Adding a number of utils for roles in JWTs and the database[0.1.3] - 2019-03-07Adding get_context to the UserRoleAssignment class.[0.1.2] - 2019-03-06Quality fixes[0.1.1] - 2019-03-06Bumping version so we get pip updated with new models we added[0.1.0] - 2019-02-28AddedFirst release on PyPI.