--- id: bridgekeeper version: "0.9" license: MIT license_treatment: permissive maintenance: dormant --- # bridgekeeper — Django permissions that work with QuerySets. License: permissive · Maintenance: dormant · Downloads: 74.6K/mo ## What it is and what it does Bridgekeeper is a Django permissions library that lets you define access rules in Python code rather than storing them in the database. Unlike django-rules, it uniquely supports both checking permissions on individual model instances and filtering QuerySets—so you can efficiently retrieve only the records a user is allowed to edit without duplicating permission logic. The package has no runtime dependencies and installs cleanly. However, it is dormant: the last release was in June 2020 and the last commit in December 2023, with no active maintenance. It was tested on Django 2.2 and 3.0 with Python 3.5–3.8, so compatibility with newer Django or Python versions is unverified. Use it for: - Build a list view that shows only the model instances a user has permission to edit, without writing permission checks twice - Define role-based or attribute-based access rules in code and apply them consistently across instance checks and QuerySet filters - Migrate from database-stored permissions to code-defined rules for easier version control and testing - Implement custom permission logic (e.g., 'user can edit their own posts') that works seamlessly with Django ORM queries ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Bridgekeeper provides a permissions system for Django projects where permissions are defined in code rather than the database, and crucially, works on both individual model instances and QuerySets. Yes, if you are on Django 2.2 or 3.0 and Python 3.5–3.8 and need QuerySet-aware permissions. The permissive MIT license and zero runtime dependencies make it low-risk. However, dormancy since 2020 means no support for newer Django or Python versions—verify compatibility with your stack before committing, and be prepared to maintain a fork if you need to upgrade Django. ## Install pip install bridgekeeper uv add bridgekeeper poetry add bridgekeeper ## Installing bridgekeeper Before you install: Installation is straightforward with no runtime dependencies. The package is dormant—last release was 2020-06-28 and last commit 2023-12-15—so expect no active maintenance or updates, though the repository remains unarchived. License in practice: Licensed under MIT (permissive), so you can use, modify, and distribute the package freely in commercial and private projects without restriction. Quickstart: pip install bridgekeeper from bridgekeeper import rules # Define a permission rule in code rules.add_rule('can_edit_post', lambda user, post: post.author == user) # Check permission on a QuerySet allowed_posts = Post.objects.filter(rules.Q('can_edit_post', user=request.user)) Requires Django 2.2 or 3.0 and Python 3.5 or later; the package is not tested against newer Django versions. Verify before relying: - Compatibility with Django versions released after 3.0 (package last tested on 3.0) - Whether the package works with modern Python versions beyond 3.8 - Current state of the codebase and whether dormancy indicates stability or abandonment ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 74.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django permissions queryset, code-based django authorization, django access control, django permission filtering, queryset permission checking, django rules alternative, model instance permissions, django-permissions, access-control, queryset-filtering [View on SkillFed](https://skillfed.io/packages/bridgekeeper) · [View on PyPI](https://pypi.org/project/bridgekeeper/)