Metadata ^as_asset not showing for public user


(Kieran) #1

Matrix Version: 6.18.1 in Squiz cloud

Hi everyone,

I have been developing a paint layout and everything has been working fine.
When I used incognito to preview the new item asset that I’ve been using to demo the paint layout, I noticed some metadata isnt printing for public (not logged in) user.

These all seem to be where “^as_asset” is used. Such as: %asset_created_by_assetid^as_asset:asset_metadata_position-title%
^This should get my ID (if I created the asset) and find a certain metadata “position-title” associated with my user asset.

Now strangely, this work when previewing while logged in.
To add confusion to this all, I have another option where I’m using a related asset on the article, linking to another persons user account: %asset_metadata_news.author.shadow^as_asset:asset_metadata_position-title%
This shows that user’s metadata “position-title”.

No issues when I view this while logged in.
Metadata, paint layout, user account and asset are all live and have public user permissions.


(Kieran) #2

Turns out this was only when the user creating the asset was myself (system admin).
If a backend user creates the asset, the asset, ^as_asset works fine and shows their metadata.

Not sure if a bug or by design, but you cant output metadata about system admin asset, only backend users and below.

Good enough for me for now.


(Bart Banda) #3

Keywords such as %asset_created_by_assetid% are permission protected so that only users who have read access to that user who created it can read their asset info. This is so that the public user can’t suddenly start seeing every Matrix user’s name, last name, email, etc, so this is intentional. The common way around this is to save this value as a metadata field against the asset and print that instead (as in, save the evaluated value, not the keyword). Hope that makes sense and helps.