archesproject / arches

Arches is a web platform for creating, managing, & visualizing geospatial data. Arches was inspired by the needs of the Cultural Heritage community, particularly the widespread need of organizations to build & manage cultural heritage inventories
GNU Affero General Public License v3.0
210 stars 139 forks source link

The `user` object is unavailable in non-top-level templates #11105

Open chrabyrd opened 6 days ago

chrabyrd commented 6 days ago

Non-top-level templates means any template not served at the end of a route. The template is bundled via webpack and treated as a static asset, so the {{ user }} is always anonymous.

This issue has been surfaced by EAMEANA, as they're attempting to conditionally display parts of the default report depending on user.

We cannot rightly depend on {{ user }} being available in these templates, and therefore need to find a decent workaround. Quite possibly either hanging the user on the arches object, or creating a get_logged_in_user api endpoint