how to check if a user having domain visibility to add him in requested for?

Kiddy1
Tera Contributor

Hello,

 

I have scripted rest web service which creates request in various domains

some user belong to one particular domain and they have other domain visibility which is set in related list of user table(domain visibility) i have user sent in json while creating request

i have a validation made that check user domain in user table and allows him to create request in that domain itself,now i need to work on additional condition that if user has other domain visibility it should allow him to create request

 

plz suggest

code will be helpful

 

thanks in advance

 

 

6 REPLIES 6

Kiddy1
Tera Contributor

here i am concerned about requested for field but not the user who authenticates

I see, is this a scripted REST API? I am actually not even sure how you would set the domain in the out of box service catalog API as it only allows users to request as themselves and seems to create everything in the default domain. If it is a scripted API you would have to query the table sys_user_visibility, where sys_domain is the domain and user is the requested for user.

In my service catalog I have created a business rule to set the company of the request to the requested for user's company every time, which takes care of the domain. I have never had a requirement to create a request for another user, and then put it in a domain other than their domain. But if you share your code I'd be happy to take a look.