How to access Resource Assignments (OwnerAssignedResourceTypes) from C# expressions?

Hello,

I’m configuring automatic assignment rules and computed properties in Netwrix Identity Manager.

From the REST API, we can access the OwnerAssignedResourceTypes of an Identity.

For example, using this API call:

/api/Resource/Directory_User/{id}?api-version=1.0
&squery= join OwnerAssignedResourceTypes art
join art.Resource artre
join art.Role artr
…
&Path=/Custom/Resources/Directory_User/ViewOwnedResources

This returns all resource type assignments for the identity, including the ResourceType code, provisioning state, workflow state, etc.

My question:

Is it possible to access these resource assignments (the same ones returned under OwnerAssignedResourceTypes in the API) from within a C# expression?

If yes:

  • What is the supported syntax to read those properties?

  • What entity or collection name do they appear under in the C# rule engine?

If not:

  • What is the recommended method to detect whether a resource type is already assigned to an identity?

Thank you!

Hello Kamil,

What is the goal you want to achieve in here?

Where will the C# expression be used?

Regards

Hazem

Hello,

We have the same need.
Some time, we want to calculate a Scalar/Aspect, which depends on multiple SingleRoles.

Sincerely,

Hello,

I’m not sure this is possible.

You might need to open a new feature request.

Regards

Hazem

Hello Hazem,

It’s a bit difficult to explain the original requirement, but I will try.

At one customer, when a user needed to be migrated, we received the information from the HR system. The migration itself had to be performed manually rather than through NIM.

The challenge was that, as soon as the HR data indicated that the user no longer required the account in a first domain, NIM would apply the current rules and deprovision the account. In reality, the account still needed to exist until the manual migration to a second domain was completed.

In this customer’s environment, NIM only had read access to the second domain, so it could not manage the migration process itself.

My goal was therefore to access the assigned resource types in a C# expression and use that information to prevent the account from being deprovisioned while it was still assigned and awaiting migration.

The expression would be used in a computed property that served as a dimension for the resource type assignment.

This is probably overengineered, but I didn’t see any other option at the time.