Access to future status details on frontend


(Matthew Harding) #1

Matrix Version: v6.31.0

We schedule a lot of future statuses and use a dashboard to have a quick overview of those assets.

As a System Admin user in the System Administrators folder I have been able to use %asset_linking_info% and SSJS to identify the future status and retrieve the required information.

However other users are prevented from getting this data despite being able to see it through the admin interface.

Does anyone know of a way around this limitation?

Cheers

Here’s the crux of the current script.

var linkingInfo = %asset_linking_info^json_decode%;
for (i=0; i<linkingInfo.length;i++){
	if(linkingInfo[i].link_value=='updating'){
        var lineage = linkingInfo[i].lineage;
        var page = lineage.pop();
		var statusValue = '%globals_asset_assetid:'+page+'^as_asset:asset_data_attributes^json_decode^index:status^index:value%';
		var whenValue = '%globals_asset_assetid:'+page+'^as_asset:asset_data_attributes^json_decode^index:when^index:value';
	}
}

(Dave Oakley) #2

hi Matthew, you mentioned that “other users are prevented from getting this data” - is that when viewing the dashboard ,the data is missing, or do you get an error?


(Matthew Harding) #3

In the dashboard (asset listing), when other users view it, they can get the lineage and page (which is actually the future status asset) however it seems they don’t have the permissions to get data about that asset as it resides underneath the scheduled jobs manager.


(Iain Simmons) #4

Hi @mharding,

Keywords like the globals ones you’re assembling in the SSJS still go through permissions checks, so I don’t think you can get around those.

An alternative would be to somehow run this code on a trigger that would be fired as yourself or Root User and save it to a static file of some sort (JS File asset for JSON or just a File/Text File for HTML, depending on what you need). Then reference that static file directly where you need to display/access it via %globals_asset_file_contents:12345%.

Hope that helps,
iain