async def test_injectable_permissions_with_operators(self):
        """Test injected permissions with operators (AND, OR, NOT)"""

        # Create services to be injected
        class AuthService:
            def is_admin(self, user):
                return user.is_staff

            def is_authenticated(self, user):
                return user.is_authenticated

        class PermissionService:
            def is_special_user(self, user):
                return getattr(user, "is_special", False)

        # Create permission classes that use dependency injection

        class AdminPermission(AsyncBasePermission):
            @inject
            def __init__(self, auth_service: AuthService):
                self.auth_service = auth_service
                self.message = "Must be admin"

            async def has_permission_async(self, request, controller):
                return self.auth_service.is_admin(request.user)

        class SpecialUserPermission(AsyncBasePermission):
            @inject
            def __init__(self, permission_service: PermissionService):
                self.permission_service = permission_service
                self.message = "Must be special user"

            async def has_permission_async(self, request, controller):
                return self.permission_service.is_special_user(request.user)

        # Register services with the injector
        injector = get_injector()
        injector.binder.bind(AuthService, to=AuthService)
        injector.binder.bind(PermissionService, to=PermissionService)

        # Create combined permissions using logical operators
        and_perm = AdminPermission & SpecialUserPermission
        or_perm = AdminPermission | SpecialUserPermission
        not_perm = ~AdminPermission

        # Create request mocks for testing
        admin_special_request = Mock(
            user=Mock(is_staff=True, is_authenticated=True, is_special=True)
        )
        admin_request = Mock(
            user=Mock(is_staff=True, is_authenticated=True, is_special=False)
        )
        special_request = Mock(
            user=Mock(is_staff=False, is_authenticated=True, is_special=True)
        )
        normal_request = Mock(
            user=Mock(is_staff=False, is_authenticated=True, is_special=False)
        )

        # AND permission - requires both admin and special
        and_result = await and_perm.has_permission_async(admin_special_request, None)
        assert and_result is True
        and_result = await and_perm.has_permission_async(admin_request, None)
        assert and_result is False
        and_result = await and_perm.has_permission_async(special_request, None)
        assert and_result is False

        # OR permission - requires either admin or special
        or_result = await or_perm.has_permission_async(admin_special_request, None)
        assert or_result is True
        or_result = await or_perm.has_permission_async(admin_request, None)
        assert or_result is True
        or_result = await or_perm.has_permission_async(special_request, None)
        assert or_result is True
        or_result = await or_perm.has_permission_async(normal_request, None)
        assert or_result is False

        # NOT permission - requires NOT admin
        not_result = await not_perm.has_permission_async(admin_request, None)
        assert not_result is False
        not_result = await not_perm.has_permission_async(normal_request, None)
        assert not_result is True
Test injected permissions with operators (AND, OR, NOT)
tests/test_async_permissions.py