Select to view content in your preferred language

Security Widget

767
2
11-01-2023 06:36 AM
Labels (2)
JeffreyThompson2
MVP Regular Contributor

I'm not sure if anyone else will find this useful, but I thought y'all might be interested in seeing this widget as it is an example of how you can alter content in an Experience based on who views it.

Here's the scenario. I built an Experience for our Telecom group to edit their data. The editing rights are restricted by the security built into the feature layer, but the Experience will be hosted on a server that can be accessed by anyone in the city government and legally only people in the Telecom group should even be allowed to see the data.

The rather silly solution I came up with was a widget that destroys the Experience if the wrong person looks at it. This widget will look at the user information in the ArcGIS Portal and if they are not in the authorized group, destroy the map and any tables in the Experience.

It initially loads with an oversized modal that blocks screen visibility. If the user is unauthorized, it will display an access denied message, while the data self-destructs behind it.

JeffreyThompson2_0-1698844916337.png

For authorized users, this model will close and the data will be unaffected. They will see their username as a subtle reminder that we know who you are.

JeffreyThompson2_1-1698845121337.png

To use this, change "Allowed Group" on line 40 to the name of the group in your ArcGIS Portal that can use this application. You may also want to alter the messages on line 73 and 84-93.

GIS Developer
City of Arlington, Texas
2 Replies
James_Kellough
Occasional Contributor

Thanks for this widget. I've played with it a little bit and think it has a lot of potential. If future iterations are planned, I would suggest including a button allowing users to return to safety or the home page of the app rather than freezing or crashing the app. User's can actually back arrow than refresh to continue using the app from the last page they're authorized to interact with but a button would simplify the process.

Very nice widget, thanks for sharing!

security-widget.png

0 Kudos
JeffreyThompson2
MVP Regular Contributor

I have no intention of developing this widget any further, but you are more than welcome to modify it as you like. For my purposes, destruction is all I need.

GIS Developer
City of Arlington, Texas