Bugfix in HasSecurityRoles#roles_not
cherry-picked from 2b16964ce0470ac24ac35aafcd696c80f32d3fa2