How to list and check user groups in AGOL WAB javascript Edit Widget

828
1
03-16-2017 12:56 PM
JoseSanchez
Occasional Contributor III

Hello everyone,

How can I check if the current user belongs to a specific group in WAP.

I need to change some editable fields to read only for a group and allow editions for another group. I was thinking of changing the source code in the Edit Widget checking the editor's group.

Scope:

For regular users the field is not editable, and populated with a default value.

For administrators, the field is editable.

Any ideas on how to implement this  functionality?

Thanks

0 Kudos
1 Reply
JoseSanchez
Occasional Contributor III

Class: PortalUser 

has a method:  

getGroups()DeferredFind all the groups that the portal user has permissions to access.

https://developers.arcgis.com/javascript/3/jsapi/portaluser-amd.html

0 Kudos