Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

To prevent non-admin users from sharing a dashboard with more than 50 members in a single request

tcsrakshash
Kilo Contributor
To prevent non-admin users from sharing a dashboard with more than 50 members in a single request
1 REPLY 1

jennifermetz1
Mega Guru

Hello @tcsrakshash,

 

I haven’t come across this issue before, but this is what I’m thinking would work.

 

I think dashboard sharing usually uses the pa_dashboards_permissions table, so you could put a simple check there with a business rule.

 

Something like... if user is not admin -> count how many members they’re trying to share with → if over 50, abort it -> show a message.

 

You might need to consider if a user tries to add a group with more than 50 members as well. So, play around with it and see how it works with groups. That would probably look like creating a loop to count the members for each group and adding it to variable for a final count. 

 

Also step back and consider if there is a better way to manage this using roles. You could setup a group to give the privilege to select trusted users. 

 

I hope this helps!

 

Jennifer Metz
Sr. ServiceNow Developer | Infosys