Links 'Add to favorites' and 'Remove from favorites' should be shown according to user favorites
The document menu shows the link 'Add to favorites' or the link 'Remove from favorites' according to a condition that ignores the current user and shows the 'Remove from favorites' link if any user has marked that document as favorite and the 'Add to favorites' link if none.
The methods condition_is_in_favorites
and condition_not_is_in_favorites
in mayan.apps.documents.links.favorite_links
should filter favorites using the user (returning something like resolved_object.favorites.filter(user=context['user']).exists()
, checking the existence of user in context before).