SONAR-4463 Updated the permission tables and the permission template select query