ADO.NET Data Services Hooking POC V4

I don’t like rights management with ADO.NET Data Services.

Indeed, you can use a method with ChangeInterceptor attribute to manage CUD operations and a QueryInterceptor attribute to manage Read operations. But if it’s a right logic, I think it should be in the entity class (in the BLL) and not in the service.

With my POC, you just need the entity type implements one or two interfaces:

public interface IEntityNeedRightToRead


    bool CanRead(string login);


public interface IEntityNeedRightsToWrite


    bool CanChange(string login, string propertyName);

    bool CanChangeLinks(string login, string propertyName);

    bool CanAdd(string login);

    bool CanDelete(string login);


Moreover, in my sample, I have the Login property in my entity types so it’s easy to return the default value of a property if you don’t want to expose it for the connected people.

The next step is, in this case, to exclude the property if it is in ETags.

This entry was posted in 7671, 8975, 9060. Bookmark the permalink.

One Response to ADO.NET Data Services Hooking POC V4

  1. Martintr says:

    Hi Matthieu
    My mistake on the can’t add new object.
    I wasn’t exposing a required DateTime field.

    Otherwise really happy with where this is going.

    I have this running to Silverlight well and so far can do most functions required at the moment.

    I will have a look at the updates when I get a chance.

    Thank you for your effort and generousity in sharing this with us.


Leave a Reply

Your email address will not be published. Required fields are marked *