- **status**: review --> closed
- **Comment**:

Looks good. Merged



---

**[tickets:#8556] deprecate and remove has_access(..)() syntax**

**Status:** closed
**Milestone:** unreleased
**Created:** Wed Apr 03, 2024 06:09 PM UTC by Dave Brondsema
**Last Updated:** Wed Jun 12, 2024 06:59 PM UTC
**Owner:** nobody


`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.


---

Sent from forge-allura.apache.org because dev@allura.apache.org is subscribed 
to https://forge-allura.apache.org/p/allura/tickets/

To unsubscribe from further messages, a project admin can change settings at 
https://forge-allura.apache.org/p/allura/admin/tickets/options.  Or, if this is 
a mailing list, you can unsubscribe from the mailing list.

Reply via email to