# Assigned users in User Management can't access the Client

**URL:** <https://forum.inductiveautomation.com/t/assigned-users-in-user-management-cant-access-the-client/15481>\
**Category:** Ignition\
**Created:** [September 27, 2017, 12:43pm UTC](https://forum.inductiveautomation.com/t/assigned-users-in-user-management-cant-access-the-client/15481 "2017-09-27T12:43:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![AkikRanade](https://avatars.discourse-cdn.com/v4/letter/a/e9bcb4/32.png) [@AkikRanade](https://forum.inductiveautomation.com/u/AkikRanade)\
**Post date:** [September 27, 2017, 12:43pm UTC](https://forum.inductiveautomation.com/t/assigned-users-in-user-management-cant-access-the-client/15481/1 "2017-09-27T12:43:40Z")

</div>

I have assigned 3 users in User, Roles section in gateway webpage under default profile. Have assigned the same in Designer’s Project Properties. But when I run my client, it logs in but fails to open the dedicated mimics that I gave the users access to. The button on which their access is granted shows disabled & few other buttons don’t even show up in the Client. What’s wrong here? 😟

 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/e/e9b69a5e18bb54de99c76bb8f76495d0b9180d54.png)  
On 1 of the buttons I have the foll script;-  
 ![](https://us1.discourse-cdn.com/inductiveautomation/original/2X/a/afc0cc85a472b2dae8a860a69209db5fa8d6aa4c.png)

---

<div class="post-metadata">

**Author:** ![MMaynard](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mmaynard/32/3366_2.png) [@MMaynard](https://forum.inductiveautomation.com/u/MMaynard)\
**Post date:** [September 27, 2017, 1:02pm UTC](https://forum.inductiveautomation.com/t/assigned-users-in-user-management-cant-access-the-client/15481/2 "2017-09-27T13:02:39Z")

</div>

Change your if to

> `if 'Administrator' or 'Manager' or 'Operator' in roles:`

Then on the Enabled property for the other buttons, use the `hasRole` expression function to enable or disable the button.

---

<div class="post-metadata">

**Author:** ![erfritts](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/erfritts/32/3660_2.png) [@erfritts](https://forum.inductiveautomation.com/u/erfritts)\
**Post date:** [September 27, 2017, 6:17pm UTC](https://forum.inductiveautomation.com/t/assigned-users-in-user-management-cant-access-the-client/15481/3 "2017-09-27T18:17:11Z")

</div>

do what he said he is right. I concur

---

<div class="post-metadata">

**Author:** ![Sanderd17](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/sanderd17/32/8735_2.png) [@Sanderd17](https://forum.inductiveautomation.com/u/Sanderd17)\
**Post date:** [September 28, 2017, 11:20am UTC](https://forum.inductiveautomation.com/t/assigned-users-in-user-management-cant-access-the-client/15481/4 "2017-09-28T11:20:22Z")

</div>

> [@MMaynard](#):
>
> ```auto
> if 'Administrator' or 'Manager' or 'Operator' in roles:
> 
> ```

The code above will not work as expected, it will evaluate as

```auto
if 'Administrator' or 'Manager' or ('Operator' in roles):

```

Which means that it will always pass as the string "Administrator" is a truthy value (any non-empty string is evaluated to True when cast to a boolean).

Just try this if you like:

```auto
myList = ["A","B","C"]
if "D" or "E" in myList:
    print "D or E in myList"
    
if "D" in myList or "E" in myList:
    print "D in myList or E in myList"

```

You will see that the first passes, even though there's no "D" nor "E" in the list, but the second test does not pass, which is correct.

So there's nothing wrong with that piece of code from the OP, the problem has to be elsewhere. Probably not with the script, but with the security bindings (right-click on a component \> security).

---

<div class="post-metadata">

**Author:** ![erfritts](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/erfritts/32/3660_2.png) [@erfritts](https://forum.inductiveautomation.com/u/erfritts)\
**Post date:** [September 28, 2017, 12:24pm UTC](https://forum.inductiveautomation.com/t/assigned-users-in-user-management-cant-access-the-client/15481/5 "2017-09-28T12:24:40Z")

</div>

I see what you mean I think what he meant was remove the u. I was just browsing and not looking to close. oops

---

<div class="post-metadata">

**Author:** ![iottest07](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/iottest07/32/17393_2.png) [@iottest07](https://forum.inductiveautomation.com/u/iottest07)\
**Post date:** [November 10, 2020, 6:43am UTC](https://forum.inductiveautomation.com/t/assigned-users-in-user-management-cant-access-the-client/15481/6 "2020-11-10T06:43:11Z")

</div>

hii you can try this it will work

role = [‘Administrator’,‘Manager’,‘Operator’]  
is\_role = False

for i in role:  
if i in system.security.getRoles():  
window = system.nav.swapTo(‘Window 1’)  
system.nav.centerWindow(window)  
is\_role = True

if is\_role == False:  
system.gui.messageBox(‘Insufficient security privileges.’)
