It's perfectly fine to give links that help support your answer, or that provide related material for interested readers.
You can even cite a book (or website) you wrote yourself (or contributed to). But if you are the author of a book you cite like that (or an employee of the publisher) you must disclose that information.
A little bit of self-promotion is acceptable, as long as you disclose your affiliation with the material. However, if the majority of your answers contain links to your books or other commercial content, then people will accuse you of using the site for free advertising, and you are likely to incur spam flags.
On the sites I frequent, we sometimes see new members citing or quoting material from their own books without proper attribution and full disclosure. But we don't blast them with spam flags for that. Instead, we explain the network rules via comments and meta links, and they then fix their posts so that they obey the rules... unless they really are spammers. ;)