Skip to main content
18-Opal
May 21, 2022
Solved

Service Permission issue.

  • May 21, 2022
  • 1 reply
  • 1086 views

Service A, is used for three different Solutions. Solution A users shouldn't be able to see the data of  Solutions B from Service A. How can I restrict this ?

@slangley @PaiChung 

Thanks,
Shashi.

Best answer by DanZ

If your service is accessing the same data source (i.e. a data table) you have to filter the returned data yourself. That means getting the user group of the user who executed the service via "let groups = Resources["CurrentSessionInfo"].GetCurrentUserGroups();"  and filter the data accordingly.

 

If your data is stored in different entities for each solution, you can just restrict the visibility to the data entities. But then you have to catch the exception that will be thrown, if your service is trying to access data sources to which the user does not have visibility rights.

1 reply

DanZ15-MoonstoneAnswer
15-Moonstone
May 23, 2022

If your service is accessing the same data source (i.e. a data table) you have to filter the returned data yourself. That means getting the user group of the user who executed the service via "let groups = Resources["CurrentSessionInfo"].GetCurrentUserGroups();"  and filter the data accordingly.

 

If your data is stored in different entities for each solution, you can just restrict the visibility to the data entities. But then you have to catch the exception that will be thrown, if your service is trying to access data sources to which the user does not have visibility rights.