[#7566] Do not check for permissions for tickets without acl settings. Use count query instead of find