Exemple #1
0
        /// <summary>
        /// Returns true if this role collection and the passed in role collection are disjoint (share no elements in
        /// common).
        /// </summary>
        /// <param name="roles">A role collection.</param>
        /// <returns><b>true</b> if the collections are disjoint, <b>false</b> otherwise.</returns>
        public virtual bool Disjoint(RoleCollection roles)
        {
            foreach (string role in this.roles.Keys)
            {
                if (roles.Contains(role))
                {
                    return(false);
                }
            }

            // no common roles, return true
            return(true);
        }
		/// <summary>
		/// Returns true if this role collection and the passed in role collection are disjoint (share no elements in
		/// common).
		/// </summary>
		/// <param name="roles">A role collection.</param>
		/// <returns><b>true</b> if the collections are disjoint, <b>false</b> otherwise.</returns>
		public virtual bool Disjoint(RoleCollection roles)
		{
			foreach(string role in this.roles.Keys)
				if (roles.Contains(role))
					return false;

			// no common roles, return true
			return true;
		}