stop using globals for rights checks