Added some code to get the correct context level for the role assignment