How to show only users with a particular role in the reference selector dropdown?

1
Let’s say, I have a “Project” entity, and I want to assign users with the role ‘developer’ to it. So I created an “Assignment” entity, associated it with “Project” and “Account” entities. So now I can create a new object of “Assignment” entity, and in the popup, I can select the developer, and select the project as reference selectors. The problem is, that I have users with different roles, not only developers in the app. How can I show in the Assignment popup, in the accounts dropdown, only users with user role “developer”?
asked
6 answers
1

In the reference selector you can use with X-path constrain 

[System.UserRoles='[%UserRole_developer%]']

answered
1

I have the same desire, however whereever I add the XPath contrain (reference selector or subsequent page) nothing is selectable

 

I would like to display users with Supervisor role assigned.

[System.UserRoles = '[%UserRole_Supervisor%]']

tried other role also, same result.

 

only an empty contrain delivers data, too much for my taste, but at least something.

answered
0

In the reference selector you can use with X-path constraint

[System.UserRoles='[%UserRole_developer%]']

IF you also grant the user role the right to manage the other user roles.

There is as far as I know no easy way to only provide only read access to user roles of other accounts.

Most developer approaches I have seen is through setting up another 1_1 account entity with its own references and such, which is supposedly more secure (or at least further away), or some helper objects and do the setting in a microflow.

answered
0

Setting a role as manager of another role not only provide read access, but also write access.

I don't think it's suitable for the user case of "assigning a task to someone with a role".

 

Creating an entity in your domain model associated with the user is certainly the most powerfull approach but it requires to carefully manage creation, etc...

 

The simplest way i found is :

  - Make an association with "Account" entity instead of "User" because the default security settings grant the read access to a few attributes like "FullName".

 

 - Use microflow as "selectable objects" source, instead of direct xpath in widget. Microflows don't comply with security access (by default), so you can retrieve the list of accounts with the expected role. If you do it with the xpath directly in the widget, the security apply and the xpath will faill to read the "UserRole" entity.

answered
-2

Maxim,

In the Selectable Objects tab of the reference selector, you can constrain the list of objects using XPath.  I think that will work in this instance.

Mike

answered
-2

I found this post, cause im looking for a solution too.
But now there is a easy way:

answered