locked
Change access rules (e.g. SetEntitySetAccessRule) based on User/Request RRS feed

  • Question

  • In WCF Data Service access rules can be set in the InitializeService static method of the service (using DataServiceConfiguration class).

    It is called only one time, to initialize service rules and permissions. I need a way to set those rules on every Request based on the User requesting the service.

    Someone knows a way (relatively simple) to achieve this?

    Thanks in advance.

    Friday, September 3, 2010 8:53 AM

Answers

  • With Entity Framework or Reflection provider this is currently not possible. But you could use query itnerceptors instead. You can add a very simple query interceptor which will always return false if the user should not have access to the given entity set. That way the user will see the entity set, but no data in it.

    Thanks,


    Vitek Karas [MSFT]
    Saturday, September 4, 2010 3:24 AM
    Moderator