From e82686d7bd10760b8fd5cf9d897af916068eab59 Mon Sep 17 00:00:00 2001 From: gfawcett Date: Fri, 20 Mar 2009 00:01:31 +0000 Subject: [PATCH] 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 --- conifer/syrup/views.py | 4 ++++ conifer/templates/admin/index.xhtml | 4 ++++ conifer/templates/components/course.xhtml | 6 ++++-- conifer/templates/master.xhtml | 1 - 4 files changed, 12 insertions(+), 3 deletions(-) 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}

+ +