Skip to content

Commit 2550199

Browse files
author
Richard Jones
committed
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.
1 parent bbefb80 commit 2550199

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

roundup/cgi/templating.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -411,14 +411,6 @@ def view_check(self):
411411
raise Unauthorised("view", self._classname,
412412
translator=self._client.translator)
413413

414-
def create_check(self):
415-
''' Raise the Unauthorised exception if the user's not permitted to
416-
create items of this class.
417-
'''
418-
if not self.is_create_ok():
419-
raise Unauthorised("create", self._classname,
420-
translator=self._client.translator)
421-
422414
def edit_check(self):
423415
''' Raise the Unauthorised exception if the user's not permitted to
424416
edit items of this class.
@@ -455,12 +447,12 @@ def is_view_ok(self):
455447
if self._db.security.hasPermission('View', self._client.userid,
456448
self._classname):
457449
return 1
458-
return self.is_create_ok()
450+
return self.is_edit_ok()
459451

460452
def is_only_view_ok(self):
461453
''' Is the user only allowed to View (ie. not Create) the current class?
462454
'''
463-
return self.is_view_ok() and not self.is_create_ok()
455+
return self.is_view_ok() and not self.is_edit_ok()
464456

465457
def __repr__(self):
466458
return '<HTMLClass(0x%x) %s>'%(id(self), self.classname)

0 commit comments

Comments
 (0)