use ENABLE_MASQUERADE in masquerade.py

This commit is contained in:
ichuang
2013-04-13 22:52:17 -04:00
parent 5ca0393e05
commit 5f74ccd1a0

View File

@@ -8,6 +8,7 @@ import json
import logging
from django.http import HttpResponse
from django.conf import settings
log = logging.getLogger(__name__)
@@ -39,6 +40,9 @@ def setup_masquerade(request, staff_access=False):
if request.user is None:
return None
if not settings.MITX_FEATURES.get('ENABLE_MASQUERADE', False):
return None
if not staff_access: # can masquerade only if user has staff access to course
return None