Home General Discussion

Create a Server-Side Function

Dorus_RolvinkDorus_Rolvink Partner IT Monkey ✭
Hi all. I've been posed the question to dynamically load in a URL for a monitor report (PRTG) based on the Company of the user. For example, User 1 works at Company A, and gets the URL for that company.
I can't find a way to put the information in a way that a logged in user can request it, and not be able to access the URL for other companies too.

To explain further: what I've done now is use JS to get session.user.Company, and then "/Dashboard/GetDashboardQueryData?query=SELECT prtgLink FROM Custom.dbo.CompanyInformation WHERE companyName = Company" to get the URL.
Clearly, someone could just change the JS, or change the query and get all the info of other companies.

I was thinking of having some code run server-side, so you'd just have an API or something, taking in the user GUID and returning the URL. Only, I can't figure out for the life of me how to add something to Cireson, as it's entire code seems to be in .dll files.

I'd be happy with an answer or just some links to related posts, KB articles etc, I can't seem to find any information on the topic, and I'm still quite a beginner in Cireson/SCSM. Maybe even just an entirely different way to get my case solved. 
Thanks in advance!


Sign In or Register to comment.