# Finding the role of a certain client in order to enable a physical pushbutton

**URL:** <https://forum.inductiveautomation.com/t/finding-the-role-of-a-certain-client-in-order-to-enable-a-physical-pushbutton/27773>\
**Category:** Ignition\
**Created:** [August 26, 2019, 6:40pm UTC](https://forum.inductiveautomation.com/t/finding-the-role-of-a-certain-client-in-order-to-enable-a-physical-pushbutton/27773 "2019-08-26T18:40:55Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 27, 2019, 12:54pm UTC](https://forum.inductiveautomation.com/t/finding-the-role-of-a-certain-client-in-order-to-enable-a-physical-pushbutton/27773/10 "2019-08-27T12:54:02Z")

</div>

I would split this requirement into two separate indicators, one for determining whether a client is running on the gateway or not, the other checking the required role.

I would implement the first requirement with a client startup script that interrogates the local network interfaces and checks for the mac IDs of the gateway (those could be hard-coded into the script). And then writes the result to a boolean tag like `[Client]RunningInGateway`. Such script only runs in a client, so designers would be excluded by default. (Note, a designer could just toggle that boolean to get around this, but you can't really stop anyone with designer privileges from going around your security.) This script might help you:

> [@Mobile Client MAC Address](http://forum.inductiveautomation.com/t/mobile-client-mac-address/23037/10):
>
> In a real Vision client, you can obtain the local MAC addresses with the following script: from java.net import NetworkInterface # Get list of local mac address as strings def myMacIds(): macs = [ni.hardwareAddress for ni in NetworkInterface.getNetworkInterfaces() if ni.hardwareAddress] return [":".join(["%02x" % (b & 0xff) for b in mac]) for mac in macs] Also, again in a real Vision client, you can obtain the outbound network interface and the corresponding local IP address the clien…

I would implement the latter requirement as a boolean custom property, `IsPrivileged` perhaps, on the window containing the restricted pushbuttons, bound to the [hasRole()](https://docs.inductiveautomation.com/display/DOC79/hasRole) expression function.

The pushbuttons in question would have the expression `{[Client]RunningInGateway} && {Root Container.IsPrivileged}` bound to their enable property.

---

_[View the full topic](https://forum.inductiveautomation.com/t/finding-the-role-of-a-certain-client-in-order-to-enable-a-physical-pushbutton/27773)._
