views:

83

answers:

1

hi, I have a Task object which has a property of Employee. Im trying to find the best possible way setting a validation to only allow the certain employees to access the task object. If the current context user (web/winforms) tries to instantiate the Task object the object should automatically validate itself and return a validation error message. Can you please advise what is the best way of doing this?

im using Fluent nHibernate and Castle Validators and the front end is asp.net MVC.

public class Task:ITask
    {
        public virtual int TaskID { get; set; }
        public virtual TaskStatus TaskStatus { get; set; }
        public virtual DateTime? CreatedDateTime { get; set; }
        **public virtual Employee CreatedByUser { get; set; }**
 }
A: 

Use a NHibernate load event listener instead of Castle Validators for this.

Mauricio Scheffer