Indonesia has rights to withdraw from ASEAN if trade agreements are not adhered to.
When rights are the simple object of a sentence I rarely see any error in student writing.
My own students write sentences like this without error. However, when adding information about these rights in a more complex sentence, they soon run into problems.
I think it’s best to look at this as a lexical issue, rather than a grammatical one.
The word rights (with ‘s’) is often used as part of a lexical phrase, like ‘human rights’, or ‘animal rights’, or ‘rights for women’. Each of these phrases refers to a set of rights (more than one) that belong to a particular group.
On the other hand if you’re only talking about a single right, as in the opening example – withdrawing from ASEAN – then the following structures are common.
Notice that the right in example 1 is one that is seldom exercised (= used), while the right (‘a right’) in example 3 is probably exercised regularly. The structure in example 3, which is not as common in academic writing, very often begins with either a proper noun or personal pronoun (in this case ‘I’).
So to return to our opening example, we need one of these:
Withdrawing from ASEAN is not a right that is exercised regularly, and so the right is more appropriate than a right.
Notice also in an earlier comment I used strong verb-noun collocation: exercise + right. For other words that collocate with right, see here, and for more examples of the structures demonstrated in this post, see here.