# Get required client roles via script

**URL:** <https://forum.inductiveautomation.com/t/get-required-client-roles-via-script/116581>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [July 29, 2026, 6:05pm UTC](https://forum.inductiveautomation.com/t/get-required-client-roles-via-script/116581 "2026-07-29T18:05:57Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rodney.oliveira1](https://avatars.discourse-cdn.com/v4/letter/r/7c8e57/32.png) [@rodney.oliveira1](https://forum.inductiveautomation.com/u/rodney.oliveira1)\
**Post date:** [July 29, 2026, 6:05pm UTC](https://forum.inductiveautomation.com/t/get-required-client-roles-via-script/116581/1 "2026-07-29T18:05:57Z")

</div>

I'm creating a "fake" login screen, because I need to control the login attempts and block users if they exceed the attempts, and I need to get the required client roles of the project via script to compare with the user roles. Is there any way to do that?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/f/6fb93095955a127334920117feb93e8bc9026981.png)

I'm building a template and I have more than 50 projects to implement, it would be much easier to get this info by the project instead of configuring all of them again manually

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [July 29, 2026, 6:22pm UTC](https://forum.inductiveautomation.com/t/get-required-client-roles-via-script/116581/2 "2026-07-29T18:22:33Z")

</div>

```python
REQUIRED_ROLES= ['Role1', 'Role2',] #etc
USER_SOURCE = 'someUserSource'

def login(username, password):
    user = system.user.getUser(USER_SOURCE, username)
    roles = user.getRoles()
    if not any([r in REQUIRED_ROLES for r roles]):
        # Bail early here, user does not have any of the roles you required

```

Something like this? This works in a "at least 1 role matches" which is what I assume you want just for a login and since you're rolling your own login logic on top of it anways.

Also you should talk to someone about upgrading from 7.9. Any bugs you run into now your only help will basically be this forum. Espeically if they're already going through the trouble of upgrading 50 projects.

---

<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:** [July 29, 2026, 6:23pm UTC](https://forum.inductiveautomation.com/t/get-required-client-roles-via-script/116581/3 "2026-07-29T18:23:46Z")

</div>

That is a binary resource prior to v8.3. Sorry.

---

<div class="post-metadata">

**Author:** ![rodney.oliveira1](https://avatars.discourse-cdn.com/v4/letter/r/7c8e57/32.png) [@rodney.oliveira1](https://forum.inductiveautomation.com/u/rodney.oliveira1)\
**Post date:** [July 29, 2026, 6:29pm UTC](https://forum.inductiveautomation.com/t/get-required-client-roles-via-script/116581/4 "2026-07-29T18:29:41Z")

</div>

Yes, but I wanted to get the required roles that are already configured in my project, instead of hardcode it, as I need to implement it to all my projects. But thanks, mate!

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [July 29, 2026, 6:32pm UTC](https://forum.inductiveautomation.com/t/get-required-client-roles-via-script/116581/5 "2026-07-29T18:32:13Z")

</div>

Oh I see you're problem now. Yea think you're out of luck. Sorry!

---

<div class="post-metadata">

**Author:** ![rodney.oliveira1](https://avatars.discourse-cdn.com/v4/letter/r/7c8e57/32.png) [@rodney.oliveira1](https://forum.inductiveautomation.com/u/rodney.oliveira1)\
**Post date:** [July 29, 2026, 6:32pm UTC](https://forum.inductiveautomation.com/t/get-required-client-roles-via-script/116581/6 "2026-07-29T18:32:45Z")

</div>

Hmmm ok, understood. So, while we don't upgrade our version, I will create a custom property and pass the roles as a parameter in my template, I think I'll have no other option. Thank you!

---

<div class="post-metadata">

**Author:** ![nminchin](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/nminchin/32/6911_2.png) [@nminchin](https://forum.inductiveautomation.com/u/nminchin)\
**Post date:** [July 30, 2026, 1:50am UTC](https://forum.inductiveautomation.com/t/get-required-client-roles-via-script/116581/7 "2026-07-30T01:50:34Z")

</div>

> [@rodney.oliveira1](#):
>
> I will create a custom property and pass the roles as a parameter in my template, I think I'll have no other option

A Vision Client tag might be another option where it's set to read-only
