Multi-domain application environments where distributed domains interoperate with each other are becoming a reality in Internet-based enterprise applications. The secure interoperation in a multidomain environment is a challenging problem. Rolebased access control (RBAC) is used for specifying the security requirements of multi-domain applications in this paper. Then, role mapping relationship between domains is described by XML documents. Furthermore, the situations where dynamic role mapping violates separation of duties (SoD) which is one of the three basic security principles for the RBAC model are analyzed in detail, and relevant algorithms to detect the above security problem are designed in this paper.