Exemple #1
0
        public virtual void UpdateCustomActions(Dictionary <int, bool> actions, PartyId userId, List <ActionType> roleActionTypes)
        {
            var newList = new List <PartyCustomAction>();

            actions.ToList().ForEach(c =>
            {
                newList.Add(new PartyCustomAction(userId, c.Key, c.Value));
            });

            this.customActions = new Dictionary <int, bool>();
            newList.ForEach(d =>
            {
                if (d.IsGranted)
                {
                    if (!roleActionTypes.Exists(c => (int)c == d.ActionTypeId))
                    {
                        this.customActions.Add(d.ActionTypeId, d.IsGranted);
                    }
                }
                else
                {
                    if (roleActionTypes.Exists(c => (int)c == d.ActionTypeId))
                    {
                        this.customActions.Add(d.ActionTypeId, d.IsGranted);
                    }
                }
            });
        }
Exemple #2
0
 public Party(PartyId id)
 {
     if (id == null)
     {
         throw new ArgumentNullException("id");
     }
     this.id = id;
 }
Exemple #3
0
 public SuperAdminUser(PartyId userId, string fName, string lName, string email)
     : base(userId, fName, lName, email)
 {
     Actions = new List <ActionType>();
     foreach (ActionType action in Enum.GetValues(typeof(ActionType)))
     {
         Actions.Add(action);
     }
 }
Exemple #4
0
 public AdminUser(PartyId userId, string fName, string lName, string email)
     : base(userId, fName, lName, email)
 {
 }
Exemple #5
0
 public PartyCustomAction(PartyId partyId, int actionTypeId, bool isGranted)
 {
     this.PartyId      = partyId;
     this.ActionTypeId = actionTypeId;
     this.IsGranted    = isGranted;
 }
Exemple #6
0
 public EmployeeUser(PartyId userId, string employeeNo, string fname, string lname, string email)
     : base(userId, fname, lname, email)
 {
     this.employeeNo = employeeNo;
 }
Exemple #7
0
 public bool SameValueAs(PartyId other)
 {
     return(PartyName.ToLower().Equals(other.partyName.ToLower()));
 }
Exemple #8
0
 public User(PartyId id, string firstname, string lastname, string email, bool isActive)
     : base(id)
 {
     setProperties(firstname, lastname, email, isActive);
 }
Exemple #9
0
 public User(PartyId id, string firstname, string lastname, string email)
     : base(id)
 {
     setProperties(firstname, lastname, email, true);
 }
Exemple #10
0
 public Group(PartyId id, string description) : base(id)
 {
     this.description = description;
 }