# \[IGN-8414\] system.perspective.isAuthorized does not work as specified

**URL:** <https://forum.inductiveautomation.com/t/ign-8414-system-perspective-isauthorized-does-not-work-as-specified/79206>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [September 15, 2023, 10:47am UTC](https://forum.inductiveautomation.com/t/ign-8414-system-perspective-isauthorized-does-not-work-as-specified/79206 "2023-09-15T10:47:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![liam1](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@liam1](https://forum.inductiveautomation.com/u/liam1)\
**Post date:** [September 15, 2023, 10:47am UTC](https://forum.inductiveautomation.com/t/ign-8414-system-perspective-isauthorized-does-not-work-as-specified/79206/1 "2023-09-15T10:47:41Z")

</div>

The system.perspective.isAuthorized function does not work as specified.

When I set the isAllOf to `False` it does not return True , even through a path that matches the users security level exist in the list.

```auto
isAuthorized=system.perspective.isAuthorized(False,['Paarl', 'Paarl/A_01', 'Paarl/A_01/PC_01'])

```

Below is a user with the following security level.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/c/d/cdaf7192ec600ea4b7505eef1cb2364b7adf666b.png)  
Here the function works , isAuthorized returns 1.  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/4/54e9f26f979313efb1f47f4f1aa944a017e00f36.png)

When I change the users security level to one level less on the gateway, but keep the path list for the function the same.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/d/6d4225bf5d44a5b7e5ff18a58c3d0496869a56bc.png)  
It fails?  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/1/d1bf7fca60ed6dfef362136a935aabd7c3144516.png)

It seems to only check the most specific path in the list instead of all items in the list ,which is not what the documentation describes.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/d/c/dccc6d8cbb9a0a35b68ec5a2ce544c5f07f9d63a.png)

---

<div class="post-metadata">

**Author:** ![liam1](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@liam1](https://forum.inductiveautomation.com/u/liam1)\
**Post date:** [September 15, 2023, 1:38pm UTC](https://forum.inductiveautomation.com/t/ign-8414-system-perspective-isauthorized-does-not-work-as-specified/79206/2 "2023-09-15T13:38:25Z")

</div>

My current work around was to create a custom function to implement this check.

Hopefully this gets fixed soon.

---

<div class="post-metadata">

**Author:** ![cmallonee](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/cmallonee/32/6416_2.png) [@cmallonee](https://forum.inductiveautomation.com/u/cmallonee)\
**Post date:** [September 15, 2023, 3:31pm UTC](https://forum.inductiveautomation.com/t/ign-8414-system-perspective-isauthorized-does-not-work-as-specified/79206/3 "2023-09-15T15:31:16Z")

</div>

That's interesting. I've verified this on our side and opened an internal ticket to address the issue. While it's unfortunate that it doesn't work in this scenario, the silver lining is that the result is a false negative instead of a false positive.

---

<div class="post-metadata">

**Author:** ![jspecht](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jspecht/32/6465_2.png) [@jspecht](https://forum.inductiveautomation.com/u/jspecht)\
**Post date:** [September 15, 2023, 5:41pm UTC](https://forum.inductiveautomation.com/t/ign-8414-system-perspective-isauthorized-does-not-work-as-specified/79206/4 "2023-09-15T17:41:31Z")

</div>

Any user granted security level `Paarl/A_01/PC_01` is granted security levels `Paarl/A_01` and `Paarl` by design. So when you make a call like this:

`system.perspective.isAuthorized(False,['Paarl', 'Paarl/A_01', 'Paarl/A_01/PC_01'])`

it simplifies to:

`system.perspective.isAuthorized(False,['Paarl'])`

system.perspective.isAuthorized does not currently perform this simplification for you, but it should in order to comply with the documented behavior and to just be nice to the user, so that is what Cody's ticket IGN-8414 will be all about.

In the meantime, you will have to manually simplify your arguments passed to the scripting function.

---

<div class="post-metadata">

**Author:** ![liam1](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@liam1](https://forum.inductiveautomation.com/u/liam1)\
**Post date:** [September 15, 2023, 6:06pm UTC](https://forum.inductiveautomation.com/t/ign-8414-system-perspective-isauthorized-does-not-work-as-specified/79206/5 "2023-09-15T18:06:44Z")

</div>

Thank you for the update.
