has_access
returns a TruthyCallable which can be treated as a bool or called again, which is confusing. There's lots of has_access(...)()
syntax that can be cleaned up now.
After cleanup is done (including within external plugins/extensions), we can then remove the TruthyCallable and predicate behavior of has_access, and have it return a simple bool.
Code changes necessary:
- has_access(...)()
-> has_access(...)
- has_access(c.app, 'read')(user=user)
-> has_access(c.app, 'read', user)
- require(has_access(c.app, 'read'))
-> require_access(c.app, 'read'))
If require(...)
is used in other situations, ideally it should be changed completely. Or, change from a callable to a bool like require(lambda: foo == bar)
-> require(foo == bar)
but this cannot be done ahead of time, it mus be done at the time of full removal.
db/8556 on allura, forgehg, and forgepastebin
db/8556-breaking-removal needs to be merged later, after we do a release and give anyone a chance to update their code. You can review and test it though.
Somehow db/8556-breaking-removal didn't have any changes in it. I re-created the changes at
db/8556-breaking-removal-2
and have run all the tests. Its ready to be mergedLooks good. Merged