| 123456789101112131415161718192021222324252627282930313233343536373839 | using System.Linq;namespace InABox.Core{    [UserTracking(typeof(User))]    [Caption("Security Overrides")]    public class UserSecurityToken : Entity, IPersistent, IRemotable, ILicense<CoreLicense>    {        [NullEditor]        [EntityRelationship(DeleteAction.Cascade)]        public UserLink User { get; set; }        [ComboLookupEditor(typeof(SecurityRestrictionGenerator))]        public string Descriptor { get; set; }        [CheckBoxEditor]        public bool Enabled { get; set; }        protected override void Init()        {            base.Init();            User = new UserLink();        }        public override string ToString()        {            return Descriptor;        }        private class SecurityRestrictionGenerator : LookupGenerator<object>        {            public SecurityRestrictionGenerator(object[] items) : base(items)            {                foreach (var descriptor in Security.Descriptors.Where(x => x.HasScope(SecurityDescriptorScope.User)))                    AddValue(descriptor.Code, descriptor.Description);            }        }    }}
 |