From: gfawcett Date: Fri, 20 Mar 2009 00:01:31 +0000 (+0000) Subject: various tweaks. Permissions fix; moving around some admin links. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e82686d7bd10760b8fd5cf9d897af916068eab59;p=syrup%2Fmasslnc.git various tweaks. Permissions fix; moving around some admin links. git-svn-id: svn://svn.open-ils.org/ILS-Contrib/servres/trunk@203 6d9bc8c9-1ec2-4278-b937-99fde70a366f --- diff --git a/conifer/syrup/views.py b/conifer/syrup/views.py index df9e3ce..dcaa316 100644 --- a/conifer/syrup/views.py +++ b/conifer/syrup/views.py @@ -149,6 +149,10 @@ def members_only(handler): def hdlr(request, course_id, *args, **kwargs): allowed = request.user.is_superuser if not allowed: + course = models.Course.objects.get(pk=course_id) + allowed = ((request.user.is_anonymous and course.access=='ANON') or \ + (request.user.is_authenticated and course.access=='LOGIN')) + if not allowed: allowed = _fast_user_membership_query(request.user.id, course_id) if allowed: return handler(request, course_id, *args, **kwargs) diff --git a/conifer/templates/admin/index.xhtml b/conifer/templates/admin/index.xhtml index d5ff32c..ff7df8a 100644 --- a/conifer/templates/admin/index.xhtml +++ b/conifer/templates/admin/index.xhtml @@ -11,6 +11,10 @@ title = _('Administrative Options')

${title}

+ +