locked
Passing parameters from client to server RRS feed

  • Question

  • Hi,

     I am currently working on the implemenation of Sync framework in my application. i have the following requirements:

    1. User has a laptop and logs into the network, connecting to the server via web services.
    2. He downloads data from 7 tables, and only those rows that he has auhtorization to. For example, if there are 10 rows in a given table, a given role/user-id mgiht have access to download only 5 rows.

    I need a way, via synchronization, where i can pass the user-id from the client, to let the server know what details to download and pass to the client.

    Is there a way i can attach parameters during sync call from client to download only specific data from server ?

    Thanks

    Jags
    • Moved by Max Wang_1983 Friday, April 22, 2011 7:45 PM forum consolidation (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Tuesday, March 4, 2008 7:33 AM

Answers

All replies

  •  jaggi1981 wrote:
    Hi,

     I am currently working on the implemenation of Sync framework in my application. i have the following requirements:

    1. User has a laptop and logs into the network, connecting to the server via web services.
    2. He downloads data from 7 tables, and only those rows that he has auhtorization to. For example, if there are 10 rows in a given table, a given role/user-id mgiht have access to download only 5 rows.

    I need a way, via synchronization, where i can pass the user-id from the client, to let the server know what details to download and pass to the client.

    Is there a way i can attach parameters during sync call from client to download only specific data from server ?

    Thanks

    Jags

     

    I have the same requirement, has anyone found an answer to this question?

    Tuesday, April 22, 2008 7:32 PM
  • Hi Jags & Thunder,

     

    I also have the need to pass custom parameters to a server procedure - I fear I cannot provide you with a solution here.

     

    But coming to Jags scenario: perhaps you can make use of one of the implicit @sync_client_id / @sync_client_id_hash / @sync_originator_id variables. If you add them as a parameter to the SqlCommand, they are are populated automatically. The ClientID should be a unique ID for a Sync-client, generated on the initial synchronization and staying the same during following Syncs. So if you can do some mapping between the client to user & rights you could implement your "conditional download".

    The other possibilty is making use of filtering, but when reading in the docs it says that filtering should better not be used for authorization needs.

     

    Regards, Andreas

     

     

    Thursday, May 15, 2008 1:24 PM
  •  

    you use the sessionVariable feature in the sync service to achieve this. please refer to the "how to use session variable" session in the sync service BOL ( link below).

     

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1219265&SiteID=1

     

    thanks

    Yunwen

    Thursday, May 15, 2008 11:58 PM
    Moderator