Skip to content

v2.4.1

@houaiai houaiai tagged this 06 Mar 04:03
- Fixed "invalid policy size" error when loading policies with think-orm 4.0
- Prevented extra fields (like table names) from being included in policy arrays
- Fixed loadPolicy() to explicitly filter returned fields
- Fixed loadFilteredPolicy() to use field() instead of hidden()

```
Casbin\Exceptions\CasbinException: invalid policy size: expected 3, got 8,
pvals: ["eve","articles","read","","","","","casbin_rule"]
```

think-orm 4.0's toArray() method returns additional fields that were not
properly filtered, causing Casbin policy size validation to fail.

- PolicyLoadingTest test suite to verify field filtering
- POLICY_LOADING_FIX.md documentation

- ✅ think-orm 2.0.53+
- ✅ think-orm 3.x
- ✅ think-orm 4.0.30+

This is a critical bug fix release. If you're using think-orm 4.0+ and
experiencing policy loading errors, please upgrade immediately.

No breaking changes. Fully backward compatible with v2.4.0.
Assets 2
Loading