Control who can add/edit/delete annotations in Power Chart

Is there any way to only allow authorized users to add/edit/delete annotations when using the Power Chart?

I can't find any setting on the gateway that can do that, so my only idea is to bind the visibility on the annotation button and annotation visibility props to an isAuthorized() expression. However this would hide it for unauthorized users... Ideally unauthorized users would be able to see annotations, but only authorized users would be able to add/edit/delete them.

Am I missing something?

I couldn't find any way of doing it myself using the normal configuration, the Power Chart has a few little buttons that I would like to be hidden, like on the Pen control display where you can't just hide the edit and delete buttons.

To get past this I've been using CSS Injection, using styles.

To hide these annotation icons, you'll want to make a new style, for example hidePowerChartInfoEdit, and in the style under background image put the CSS code

}.psc-hidePowerChartInfoEdit .ia_powerChartComponent__label__icon.icon { display: none !important; }{

Keep in mind if you put this style in a different folder, you'll need to edit the CSS so it can find the name.

This injects into the browser CSS for it to not display those icons. You can then bind the class of the powerchart to use these styles when whatever user role is logged in.

To make you own just use the browsers HTML inspector to get the name of the part you want to hide.

1 Like

note that hidding things alone isnt 100% secure, it still gets rendered in the browser and someone can unhidde them there by removing the css localy with the browser inspector tools

1 Like

That would be the same with the enable option on a button in the component props though, only can be really secure by locking off the view with security zoning or using the perspective workstation to prevent using the inspector.

1 Like

Thanks for the replies.

Looks like I'll have to end up doing the CSS injection thing. I just wish there was a built in (non hacky) way to to this...

there is a stylescheet.css where you can dont need injection (8.1.22+), you still need to know about css though

https://docs.inductiveautomation.com/display/DOC81/Style+Classes#StyleClasses-EnablingtheAdvancedStylesheet

2 Likes

Oh I didn't know this had recently become a supported feature, I'll need to start migrating my CSS injectors.

Thanks!