I'm toying with an auction site idea, mostly to brush up my .Net 3.5, and I have an interesting problem. If I have objects who's permissions, and possibly behaviour is dependant on the currently active user, how do I tell them about it?
I could first mark every object with an interface.
public interface ICurrentUserAware
{
Person CurrentUser { get; set; }
}
Then inject each one as it was loaded from the database using the Hibernate Template's interceptor functionality.