/// <summary>
        /// Checks the validity of the specified access rights.
        /// </summary>
        /// <param name="value">The access rights to check.</param>
        protected virtual void ValidateRights(IEnumerable <AccessRights> value)
        {
            if (value == null || !value.Any <AccessRights>() || value.Count <AccessRights>() > 3)
            {
                throw new ArgumentException(SRClient.NullEmptyRights((object)3));
            }

            if (!AuthorizationRule.AreAccessRightsUnique(value))
            {
                throw new ArgumentException(SRClient.CannotHaveDuplicateAccessRights);
            }
        }
        internal void Validate()
        {
            if (this.Rights == null || !this.Rights.Any <AccessRights>() || this.Rights.Count <AccessRights>() > 3)
            {
                throw new InvalidDataContractException(SRClient.NullEmptyRights((object)3));
            }

            if (!AuthorizationRule.AreAccessRightsUnique(this.Rights))
            {
                throw new InvalidDataContractException(SRClient.CannotHaveDuplicateAccessRights);
            }

            this.OnValidate();
        }