cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

Restrict roles in User Picker

Sha11
14-Alexandrite

Restrict roles in User Picker

Hello,

 

I have an attribute under WTDocument which is customized to be a user picker using the data utility functionality. I want to restrict the selection of users to a specific role i.e., only the users under that role should be made available for selection. Request your insights for the same.

 

Thanks,

Sha

ACCEPTED SOLUTION

Accepted Solutions
Sha11
14-Alexandrite
(To:HelesicPetr)

Thank you for the response, @HelesicPetr .

Turns out there is a simpler way to do it by using the API, PickerRenderConfigs.BASE_WHERE_CLAUSE. Still in the testing phase of the API, will provide updates if it worked.

View solution in original post

4 REPLIES 4
HelesicPetr
22-Sapphire I
(To:Sha11)

Hi @Sha11 

Use a condition in the Datautility if the attribute is editable or not.

Check what user is logged in by WTPrincipal realUser = SessionHelper.manager.getPrincipal(); and check if the user is part of your role or group as you need.

Based on the condition set the edit mode of the attribute.

 

PetrH

Sha11
14-Alexandrite
(To:HelesicPetr)

Hello @HelesicPetr ,

I think there is a gap between my statement and your understanding. The requirement is when a user tries to populate the attribute using the user picker, any user can be selected as of now, the requirement is to restrict the user pool from a particular role, so that only users belonging to that group can be selected. 

HelesicPetr
22-Sapphire I
(To:Sha11)

Hi @Sha11 

Ah so write a code to get the users from your group and add them to the picker.

You can do it all in the datautility.

PetrH

Sha11
14-Alexandrite
(To:HelesicPetr)

Thank you for the response, @HelesicPetr .

Turns out there is a simpler way to do it by using the API, PickerRenderConfigs.BASE_WHERE_CLAUSE. Still in the testing phase of the API, will provide updates if it worked.

Announcements

Top Tags