limiting the user's view based on log in credentials

669
3
10-23-2012 06:57 AM
evanpicard
New Contributor II
I've got sales territories across the US.

I want sales managers to be able to log in, and only be able to see data from a nationwide data set limited to their own territory. There is a possibility we'd want some layers limited, and other layers nation-wide.

I'm sure there are round-about ways to do with multiple layers for each territory, but I'd like to tackle this as straight forward as possible.

Can someone point me in the right direction or give me some ideas?  A sample maybe?

Thank you,
Evan

system details - SQL server 2008, ArcGIS Server 10, javascript API
0 Kudos
3 Replies
nicogis
MVP Frequent Contributor
if you use feature service you can use defaultDefinitionExpression for filter data http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/featurelayer.htm .

in 10.1 you can also use LayerDataSource for definition source (data native rdbms)  http://help.arcgis.com/en/webapi/javascript/arcgis/help/jsapi/layerdatasource.htm

However for protect you filter you need apply your filter at level of proxy using for example in function of login (server side) a lookup user - filter 'unknown'
0 Kudos
evanpicard
New Contributor II
Thank you! Yes, definition query makes sense.  But I'm not sure I understand that last part.

However for protect you filter you need apply your filter at level of proxy using for example in function of login (server side) a lookup user - filter 'unknown'

Can you please explain?

Thank you!
Evan
0 Kudos
nicogis
MVP Frequent Contributor
js (or web client in general) does request client side: a manager log in your app and he can see request with filter (defaultDefinitionExpression ) for his data, so he can do request (rest) for another nationwide data if he understand the logic of criterio filter so you should obfuscate this filter.
0 Kudos