Visibility of components/assets

Hi,

I have 3 components/Assets and 10 users. Eventually, I will have more than 100 components/Assets and more than 100 users. This is in perspective.

I am using the user-role right now to give read/write abilities. Some users will have read-write abilities and can see all or can see only some or only one. Some users will have read-only and can see all or can see only some or only one.

Trying to figure out a way to change the visibility of components using user-role and username. Right now from what I know it seems like I will have to add new blocks of scripts every time a new user is added or a new component/asset is added.

Is there a different way so that it is dynamic and doesn’t require updating the script every time a user is added or an asset is added?

Kind Regards,
Thank you.

Could you use a database table that combines the asset, username and a permission?

Hi,
I am not sure how to do that. I tried googling and finding something on ignition manual with no luck.
Could you please point me on how this can be done?

Thank you very much.

Have a table that has columns in that you want.

IE id,username,asset,permission.
Then in perspective you would query for the username and asset to get the permission. Set that as a session variable and then you are done.

select permission from tbluserassets where username = 'username' and asset = 'asset'

So you would need to maintain a table for the assets and users, which would be easier then a large function.