fix: assignment lose if reuse the `assignments` param when calling setAssignmentsOfResource() or grantAssignmentsOfResource() more than 1 time.