{"id":24152,"library":"openedx-authz","title":"Open edX AuthZ","description":"Open edX AuthZ provides the architecture and foundations of the authorization framework for the Open edX platform. Currently at version 1.15.0 (requires Python >=3.12), it offers a REST API for managing roles, scopes, and role assignments. The library is actively maintained by the Open edX community with regular releases.","status":"active","version":"1.15.0","language":"python","source_language":"en","source_url":"https://github.com/openedx/openedx-authz","tags":["authorization","roles","permissions","openedx"],"install":[{"cmd":"pip install openedx-authz","lang":"bash","label":""}],"dependencies":[],"imports":[{"note":"The API client is under the api.v1 submodule, not top-level.","wrong":"from openedx_authz import RoleAssignmentAPIClient","symbol":"RoleAssignmentAPIClient","correct":"from openedx_authz.api.v1 import RoleAssignmentAPIClient"},{"note":"AuthzService is part of the role_api module, not directly in openedx_authz.","wrong":"from openedx_authz import AuthzService","symbol":"AuthzService","correct":"from openedx_authz.role_api import AuthzService"},{"note":"RoleModelHelper is defined in models.py, not helpers.","wrong":"from openedx_authz.helpers import RoleModelHelper","symbol":"RoleModelHelper","correct":"from openedx_authz.models import RoleModelHelper"}],"quickstart":{"code":"from openedx_authz.api.v1 import RoleAssignmentAPIClient\nClient = RoleAssignmentAPIClient(base_url='http://localhost:8000', api_key=os.environ.get('API_KEY', ''))\n# Example: list role assignments\nassignments = Client.list_role_assignments()\nprint(assignments)","lang":"python","description":"Initialize the REST API client and fetch role assignments."},"warnings":[{"fix":"Upgrade Python to 3.12 or later.","message":"Python 3.12 is required as of v1.15.0. Older Python versions will cause import errors.","severity":"breaking","affected_versions":">=1.15.0"},{"fix":"Use keyword arguments: Client.list_role_assignments(org='my_org') instead of Client.list_role_assignments('my_org').","message":"The API client methods (e.g., list_role_assignments) now require keyword arguments for filters since v1.10.0. Passing positional arguments will result in a TypeError.","severity":"gotcha","affected_versions":">=1.10.0"},{"fix":"Update payload to include scopes as a list: {\"scopes\": [\"scope1\", \"scope2\"]}.","message":"The PUT /api/authz/v1/roles/users/ endpoint now supports bulk scopes as of v1.11.0; the old single-scope format is deprecated.","severity":"deprecated","affected_versions":">=1.11.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install openedx-authz' and ensure you are in the correct virtual environment.","cause":"Package not installed or installed in a different environment.","error":"ModuleNotFoundError: No module named 'openedx_authz'"},{"fix":"Use 'from openedx_authz.api.v1 import RoleAssignmentAPIClient'.","cause":"Incorrect import path; the class is under openedx_authz.api.v1.","error":"ImportError: cannot import name 'RoleAssignmentAPIClient' from 'openedx_authz'"},{"fix":"Use keyword arguments: Client.list_role_assignments(org='my_org') instead of Client.list_role_assignments('my_org').","cause":"Passing filters as positional arguments is not allowed since v1.10.0.","error":"TypeError: list_role_assignments() takes 1 positional argument but 2 were given"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}