I want to make sure that a certain content type is only visible to users with a specific role.
I've already got a taxonomy vocab called 'role requirements' and Taxonomy Access Permissions set up to do the right thing for the right roles, so this boils down to making sure that any new content of a particular type is assigned a particular taxonomy term.
I wrote a couple of rules to do this and it all works nicely except that I get an error if the user has been diligent and already assigned that term to the node. The system still works, but I don't really want SQL errors appearing...
So what I'd really like to do is assign the term if it isn't already assigned.
Can someone point me at a concise bit of PHP to check whether the node being saved already has a term, or suggest a better way of doing it?
It seems as if a check for a taxonomy term would be a very useful condition to have in general...
Thanks!