# Visibility of components/assets

**URL:** <https://forum.inductiveautomation.com/t/visibility-of-components-assets/39519>\
**Category:** Ignition\
**Created:** [October 8, 2020, 10:11pm UTC](https://forum.inductiveautomation.com/t/visibility-of-components-assets/39519 "2020-10-08T22:11:05Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kumar.chellappan](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@kumar.chellappan](https://forum.inductiveautomation.com/u/kumar.chellappan)\
**Post date:** [October 8, 2020, 10:11pm UTC](https://forum.inductiveautomation.com/t/visibility-of-components-assets/39519/1 "2020-10-08T22:11:05Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [October 9, 2020, 1:46pm UTC](https://forum.inductiveautomation.com/t/visibility-of-components-assets/39519/2 "2020-10-09T13:46:29Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kumar.chellappan](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@kumar.chellappan](https://forum.inductiveautomation.com/u/kumar.chellappan)\
**Post date:** [October 9, 2020, 4:19pm UTC](https://forum.inductiveautomation.com/t/visibility-of-components-assets/39519/3 "2020-10-09T16:19:58Z")

</div>

> [@bschroeder](#):
>
> Could you use a database table

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.

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [October 9, 2020, 4:36pm UTC](https://forum.inductiveautomation.com/t/visibility-of-components-assets/39519/4 "2020-10-09T16:36:43Z")

</div>

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.

```auto
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.
