Example #1
0
 def has_delete_permission(self, obj=None):
     if obj:
         return has_permission_for_obj(self.user, obj, 'delete')
     return ('delete' not in self.remove_permissions) and self.user.has_perm('%s.delete_%s' % self.model_info)
Example #2
0
 def has_view_permission(self, obj=None):
     if obj:
         return has_permission_for_obj(self.user, obj, 'view')
     return ('view' not in self.remove_permissions) and (self.user.has_perm('%s.view_%s' % self.model_info) or \
         self.user.has_perm('%s.change_%s' % self.model_info))