We are trying to use the unsigned macros {% CurrentDocument.DocumentName @%}
everywhere. The advantage of unsigned macros is that they do not store an identifier of the author or a security hash. The issue is that unsigned macros are always evaluated with the permissions of a public user. As a result, expressions that require any permissions will not resolve correctly.
So technically you need to use macro identity for those cases where permissions are required. If you have several developers working on the project they can share the same macro identity (for example global admin which exists in all environments). So when move objects from between environments there is no macro security issues, because the global admin identity - exist everywhere. Global Admin perhaps not a good example but you can use an identity that you are comfortable with and it exists in all environments.