Quantcast
Channel: security roles at property level
Viewing all articles
Browse latest Browse all 3

security roles at property level

0
0
I use membership in active directory roles as a security mechanism in my applications. I want to disallow changes at the property level in my viewmodel unless the user has the appropriate permissions. I can easily disable the controls in the view, but would rather have the viewmodel handle the security. For example, assuming I have a bool property named IsAdmin and I want to block all but application admins from changing the following property:


        public string MajorLocationID
        {
            get { return CurrentEquipment.major_location_id; }
            set
            {
                if (CurrentEquipment.major_location_id != value)
                {
                    CurrentEquipment.major_location_id = value;

                    OnPropertyChanged("MajorLocationID");
                }
            }
        }


I am not sure quite how to go about this. Also, any suggested reading with regards to implementing security using the MVVM pattern would be greatly appreciated.

Thanks.

Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images