Question How To Bracket The Data In Webservice Procedure

Hi,

I have to develop webservice to bring the Sales order data.
1.Customers can fetch the data.
2.Customer Admin can fetch data
3.Sales rep can fetch data

Data will be same always however when customer logins he can see only his sales order data, if customer admin logins he can view all customer's data , if sales person logins he can see his (sales person's) sales order details irrespective of any customers.

How we can elegantly handle this type of requirement ? Through input parameters?

TIA
-Philip-
 

Cringer

ProgressTalk.com Moderator
Staff member
This could be achieved with partitioning I'd have thought? Depends on how you manage the security side of things at the moment though, and which version of Progress?
 

TomBascom

Curmudgeon
run getOrders( input "someUserName", output orderList ).

or perhaps

run getOrders( input "someUserName", input "userRole", output orderList ).

I suspect that your real problem is that you do not know how to structure the hierarchy of customers, sales persons and administrators. A great deal of that depends on how your actual db is designed -- your order table might, for instance, have fields for each of those roles which would make the queries trivial. Just figure out what the role of the user is and select based on that role.

Or you might have a table that lists the customers associated with a sales person and find it easiest to use nested loops... without knowing your db structure one really can't say how to solve the problem.

But I'm pretty sure that it is just a matter of coding queries and has absolutely nothing to do with web services.
 
Top