# Getting project UserSource separately

**URL:** <https://forum.inductiveautomation.com/t/getting-project-usersource-separately/87480>\
**Category:** Ignition\
**Created:** [March 18, 2024, 12:08pm UTC](https://forum.inductiveautomation.com/t/getting-project-usersource-separately/87480 "2024-03-18T12:08:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mehrdad\_Telli](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mehrdad_telli/32/77763_2.png) [@Mehrdad\_Telli](https://forum.inductiveautomation.com/u/Mehrdad_Telli)\
**Post date:** [March 18, 2024, 12:08pm UTC](https://forum.inductiveautomation.com/t/getting-project-usersource-separately/87480/1 "2024-03-18T12:08:33Z")

</div>

Is there a way to get UserSources and their Failover Source for each project on the gateway separately ?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 18, 2024, 2:31pm UTC](https://forum.inductiveautomation.com/t/getting-project-usersource-separately/87480/2 "2024-03-18T14:31:02Z")

</div>

Not easily/not in a supported manner. You have to reach into each project and pull out a specific "global props" resource, which requires some care.

Before we get into all the "how", though, can you tell us more about the "why" you're looking for this info?

---

<div class="post-metadata">

**Author:** ![Mehrdad\_Telli](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mehrdad_telli/32/77763_2.png) [@Mehrdad\_Telli](https://forum.inductiveautomation.com/u/Mehrdad_Telli)\
**Post date:** [March 18, 2024, 2:54pm UTC](https://forum.inductiveautomation.com/t/getting-project-usersource-separately/87480/3 "2024-03-18T14:54:04Z")

</div>

To manage users, I need to retrieve the user source based on the selected project. This will allow the admin to control which project users have access to the project view.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 18, 2024, 6:04pm UTC](https://forum.inductiveautomation.com/t/getting-project-usersource-separately/87480/4 "2024-03-18T18:04:01Z")

</div>

I'll point out for posterity that our current license agreement doesn't allow "multi-tenant" hosted Ignition outside of specific scenarios, but I'm also not a lawyer and that may not be what you're doing at all.

As for the question at hand: basically, you're diving head first into deep waters. The way to do this is literally going to be the same way we do it in our code, but is also going to be subject to change at any moment - this is **not** a part of our public API contract so once you start doing this, you cannot expect your project to seamlessly upgrade between major versions. I can explicitly **guarantee** that any code you write to handle this in 8.1 will not work on 8.3.0 once it's released around the end of this year.

All that aside:

- You'll want to run this code on the gateway.
- You need a reference to the gateway context. Examples are all over the forum. This is your first step off the safe beach into the "you could break your whole project" waters.
- From that GatewayContext, you'll retrieve an instance of the ProjectManager class. As the name implies, this houses all your projects.
- Next, you'll retrieve your project(s) by name, then retrieve the global props singleton resource by ResourcePath.
- Then you'll use ResourceUtil to deserialize the resource data into a useful Java object - an instance of the GlobalProps class.
- Then you'll extract the user source name from that class instance.

> **[GatewayContext](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.37/com/inductiveautomation/ignition/gateway/model/GatewayContext.html)**
>
> declaration: package: com.inductiveautomation.ignition.gateway.model, interface: GatewayContext

> **[ProjectManager](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.37/com/inductiveautomation/ignition/gateway/project/ProjectManager.html)**
>
> declaration: package: com.inductiveautomation.ignition.gateway.project, interface: ProjectManager

> **[RuntimeProject](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.37/com/inductiveautomation/ignition/common/project/RuntimeProject.html)**
>
> declaration: package: com.inductiveautomation.ignition.common.project, class: RuntimeProject

> **[ResourcePath](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.37/com/inductiveautomation/ignition/common/project/resource/ResourcePath.html)**
>
> declaration: package: com.inductiveautomation.ignition.common.project.resource, class: ResourcePath

> **[ResourceUtil](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.37/com/inductiveautomation/ignition/common/util/ResourceUtil.html)**
>
> declaration: package: com.inductiveautomation.ignition.common.util, class: ResourceUtil

> **[GlobalProps](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.37/com/inductiveautomation/ignition/common/project/GlobalProps.html)**
>
> declaration: package: com.inductiveautomation.ignition.common.project, class: GlobalProps

---

<div class="post-metadata">

**Author:** ![Mehrdad\_Telli](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mehrdad_telli/32/77763_2.png) [@Mehrdad\_Telli](https://forum.inductiveautomation.com/u/Mehrdad_Telli)\
**Post date:** [March 18, 2024, 6:49pm UTC](https://forum.inductiveautomation.com/t/getting-project-usersource-separately/87480/5 "2024-03-18T18:49:10Z")

</div>

While we are supposed to use the gateway api to access the ProjectManager, why doesn't it work in the major upgrade? it means gateway api will change in every major upgrade?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [March 18, 2024, 6:59pm UTC](https://forum.inductiveautomation.com/t/getting-project-usersource-separately/87480/6 "2024-03-18T18:59:42Z")

</div>

Within minor versions (8.1.x to 8.1.y), APIs are consistent on a "best effort" basis, to reduce pain for our module development partners and third parties.

Major versions (8.x to 8.y) are explicitly used to give us an opportunity to break APIs and make more sweeping changes. I can guarantee anything you do _in this area_ will break because we're expanding the resource system used for projects to include all gateway config, more or less. This will involve, at minimum, renaming packages and classes involved.

---

<div class="post-metadata">

**Author:** ![Mehrdad\_Telli](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mehrdad_telli/32/77763_2.png) [@Mehrdad\_Telli](https://forum.inductiveautomation.com/u/Mehrdad_Telli)\
**Post date:** [March 18, 2024, 7:05pm UTC](https://forum.inductiveautomation.com/t/getting-project-usersource-separately/87480/7 "2024-03-18T19:05:31Z")

</div>

If this happens, all third-party modules must be upgraded to the new version ?

---

<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:** [March 18, 2024, 7:07pm UTC](https://forum.inductiveautomation.com/t/getting-project-usersource-separately/87480/8 "2024-03-18T19:07:55Z")

</div>

Yes. IA does not guarantee **any** APIs in its SDK. IA's past practice is as Paul described, where some of my modules worked unchanged across major upgrades and other modules broke all over the place.

That just the way it is. If your environment suffers from that, stay on a single LTS version as long as you can.

---

<div class="post-metadata">

**Author:** ![Mehrdad\_Telli](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mehrdad_telli/32/77763_2.png) [@Mehrdad\_Telli](https://forum.inductiveautomation.com/u/Mehrdad_Telli)\
**Post date:** [March 18, 2024, 7:37pm UTC](https://forum.inductiveautomation.com/t/getting-project-usersource-separately/87480/9 "2024-03-18T19:37:08Z")

</div>

Just like Android apps with new versions.
