Added rights to soc/views/models/timeline.py.
authorLennard de Rijk <ljvderijk@gmail.com>
Sat, 31 Jan 2009 13:49:50 +0000
changeset 1108 64acc3c02ad1
parent 1107 a878188e225c
child 1109 a83d8c5e6650
Added rights to soc/views/models/timeline.py. Only a developer or a host for the program this timeline is for can edit it now. Patch by: Lennard de Rijk Reviewed by: to-be-reviewed
app/soc/views/models/timeline.py
--- a/app/soc/views/models/timeline.py	Sat Jan 31 13:48:48 2009 +0000
+++ b/app/soc/views/models/timeline.py	Sat Jan 31 13:49:50 2009 +0000
@@ -29,6 +29,7 @@
 
 from soc.logic import dicts
 from soc.logic.models import program as program_logic
+from soc.views.helper import access
 from soc.views.helper import dynaform
 from soc.views.helper import params as params_helper
 from soc.views.models import base
@@ -48,7 +49,11 @@
       params: a dict with params for this View
     """
 
+    rights = access.Checker(params)
+    rights['edit'] = ['checkCanEditTimeline']
+
     new_params = {}
+    new_params['rights'] = rights
     new_params['logic'] = soc.logic.models.timeline.logic
     new_params['edit_template'] = 'soc/timeline/edit.html'
     new_params['name'] = "Timeline"