public override bool Equals(object obj)
 {
     if (obj is AuthRole)
     {
         AuthRole _obj = obj as AuthRole;
         if (string.IsNullOrEmpty(_obj.RoleName))
         {
             return(false);
         }
         if (_obj.RoleName.Equals(RoleName))
         {
             return(true);
         }
     }
     return(false);
 }
        public bool HasRole(AuthRole role, bool recursive)
        {
            foreach (AuthRole child_role in Children)
            {
                if (child_role.Equals(role))
                {
                    return(true);
                }
                if (recursive)
                {
                    if (child_role.HasRole(role, recursive))
                    {
                        return(true);
                    }
                }
            }

            return(false);
        }
 public void RemoveRole(AuthRole role)
 {
     Children.Remove(role);
 }