changeset 2651:17bab083c8a0

Couple of fixes - make the interface just be is_edit_ok... ...so template writing is easier. Will check for Edit or Create permission as appropriate.
author Richard Jones <richard@users.sourceforge.net>
date Wed, 28 Jul 2004 05:10:45 +0000
parents d68a444fcce3
children 281beec48408
files roundup/cgi/templating.py
diffstat 1 files changed, 2 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/roundup/cgi/templating.py	Wed Jul 28 05:00:32 2004 +0000
+++ b/roundup/cgi/templating.py	Wed Jul 28 05:10:45 2004 +0000
@@ -411,14 +411,6 @@
             raise Unauthorised("view", self._classname,
                 translator=self._client.translator)
 
-    def create_check(self):
-        ''' Raise the Unauthorised exception if the user's not permitted to
-            create items of this class.
-        '''
-        if not self.is_create_ok():
-            raise Unauthorised("create", self._classname,
-                translator=self._client.translator)
-
     def edit_check(self):
         ''' Raise the Unauthorised exception if the user's not permitted to
             edit items of this class.
@@ -455,12 +447,12 @@
         if self._db.security.hasPermission('View', self._client.userid,
                 self._classname):
             return 1
-        return self.is_create_ok()
+        return self.is_edit_ok()
 
     def is_only_view_ok(self):
         ''' Is the user only allowed to View (ie. not Create) the current class?
         '''
-        return self.is_view_ok() and not self.is_create_ok()
+        return self.is_view_ok() and not self.is_edit_ok()
 
     def __repr__(self):
         return '<HTMLClass(0x%x) %s>'%(id(self), self.classname)

Roundup Issue Tracker: http://roundup-tracker.org/