# Check role to open page

**URL:** <https://forum.inductiveautomation.com/t/check-role-to-open-page/54539>\
**Category:** Ignition\
**Created:** [December 30, 2021, 12:52pm UTC](https://forum.inductiveautomation.com/t/check-role-to-open-page/54539 "2021-12-30T12:52:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [December 30, 2021, 12:52pm UTC](https://forum.inductiveautomation.com/t/check-role-to-open-page/54539/1 "2021-12-30T12:52:19Z")

</div>

Good afternoon,

I would like to ask your help to understand which is the better way to check the actual role with a dataset of roles to open a page.

I create a dataset memory tag where I add the roles I want to be able to open the page.  
Then I add this code to the mouseReleased event:

```auto

val = system.dataset.toPyDataSet(system.tag.read('myPath').value)
role = system.security.getRoles()

# Convert to a PyDataset
pyData = system.dataset.toPyDataSet(val)
 
# The for loop pulls out the whole row, so typically the variable row is used.
for row in pyData:
    # Now that we have a single row, we can loop through the columns just like a list.
    for value in row:

    	if value in role:

			window = system.nav.openWindow('myPage')

```

Is there a better way to do this with a view to having more page to manage ?

Thanks a lot

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [December 30, 2021, 1:41pm UTC](https://forum.inductiveautomation.com/t/check-role-to-open-page/54539/2 "2021-12-30T13:41:41Z")

</div>

Why do you not use the built-in security settings?

I’m assuming you’re using _Vision_ in which case you click on the view and hit `Ctrl-E` (or right-click on the _Project Browser_ item and select _Security_).

---

<div class="post-metadata">

**Author:** ![Aiasa21](https://avatars.discourse-cdn.com/v4/letter/a/aeb1de/32.png) [@Aiasa21](https://forum.inductiveautomation.com/u/Aiasa21)\
**Post date:** [December 30, 2021, 2:33pm UTC](https://forum.inductiveautomation.com/t/check-role-to-open-page/54539/3 "2021-12-30T14:33:44Z")

</div>

I would like to have a tag to manage the roles so if I have to change it, so I change only in one place.

If there’s a way to use the built-in and set the roles dynamically it should be great.
