comparison roundup/cgi/templating.py @ 6150:edbd4bba728a

Add 'is_restore_ok' method
author Ralf Schlatterbeck <rsc@runtux.com>
date Fri, 01 May 2020 16:33:05 +0200
parents 38fbfbb24cbd
children af372b9372f6
comparison
equal deleted inserted replaced
6149:6a2de9606652 6150:edbd4bba728a
618 def is_retire_ok(self): 618 def is_retire_ok(self):
619 """ Is the user allowed to retire items of the current class? 619 """ Is the user allowed to retire items of the current class?
620 """ 620 """
621 perm = self._db.security.hasPermission 621 perm = self._db.security.hasPermission
622 return perm('Web Access', self._client.userid) and perm('Retire', 622 return perm('Web Access', self._client.userid) and perm('Retire',
623 self._client.userid, self._classname)
624
625 def is_restore_ok(self):
626 """ Is the user allowed to restore retired items of the current class?
627 """
628 perm = self._db.security.hasPermission
629 return perm('Web Access', self._client.userid) and perm('Restore',
623 self._client.userid, self._classname) 630 self._client.userid, self._classname)
624 631
625 def is_view_ok(self): 632 def is_view_ok(self):
626 """ Is the user allowed to View the current class? 633 """ Is the user allowed to View the current class?
627 """ 634 """
931 def is_retire_ok(self): 938 def is_retire_ok(self):
932 """ Is the user allowed to Reture this item? 939 """ Is the user allowed to Reture this item?
933 """ 940 """
934 perm = self._db.security.hasPermission 941 perm = self._db.security.hasPermission
935 return perm('Web Access', self._client.userid) and perm('Retire', 942 return perm('Web Access', self._client.userid) and perm('Retire',
943 self._client.userid, self._classname, itemid=self._nodeid)
944
945 def is_restore_ok(self):
946 """ Is the user allowed to restore this item?
947 """
948 perm = self._db.security.hasPermission
949 return perm('Web Access', self._client.userid) and perm('Restore',
936 self._client.userid, self._classname, itemid=self._nodeid) 950 self._client.userid, self._classname, itemid=self._nodeid)
937 951
938 def is_view_ok(self): 952 def is_view_ok(self):
939 """ Is the user allowed to View this item? 953 """ Is the user allowed to View this item?
940 """ 954 """

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