'Return a version of this context with admin flag set.'

def elevated(self, read_deleted=None):

    context = copy.copy(self)
    context.roles = copy.deepcopy(self.roles)
    context.is_admin = True
    if ('admin' not in context.roles):
        context.roles.append('admin')
    if (read_deleted is not None):
        context.read_deleted = read_deleted
    return context
