@@ -1022,16 +1022,14 @@ def history(self, nodeid, enforceperm=True, skipquiet=True):
10221022 perm = self .db .security .hasPermission
10231023 journal = []
10241024
1025- debug_logging = logger .isEnabledFor (logging .DEBUG )
1026-
10271025 uid = self .db .getuid () # id of the person requesting the history
10281026
10291027 for j in self .db .getjournal (self .classname , nodeid ):
10301028 # hide/remove journal entry if:
10311029 # property is quiet
10321030 # property is not (viewable or editable)
10331031 id , evt_date , user , action , args = j
1034- if debug_logging :
1032+ if logger . isEnabledFor ( logging . DEBUG ) :
10351033 j_repr = "%s" % (j ,)
10361034 else :
10371035 j_repr = ''
@@ -1061,47 +1059,58 @@ def history(self, nodeid, enforceperm=True, skipquiet=True):
10611059 continue
10621060 journal .append (j )
10631061 elif action in ['link' , 'unlink' ] and type (args ) == type (()):
1064- # hide/remove journal entry if:
1065- # link property (key) is quiet
1066- # link property is not (viewable or editable)
1067- # id/object (linkcl, linkid) that is linked/unlinked is not
1068- # (viewable or editable)
1062+ # definitions:
1063+ # myself - object whose history is being filtered
1064+ # linkee - object/class whose property is changing to
1065+ # include/remove myself
1066+ # link property - property of the linkee class that is changing
1067+ #
1068+ # Remove the history item if
1069+ # linkee.link property (key) is quiet
1070+ # linkee class.link property is not (viewable or editable)
1071+ # to user
1072+ # [ should linkee object.link property is not
1073+ # (viewable or editable) to user be included?? ]
1074+ # linkee object (linkcl, linkid) is not
1075+ # (viewable or editable) to user
10691076 if len (args ) == 3 :
1070- '''
10711077 # e.g. for issue3 blockedby adds link to issue5 with:
10721078 # j = id, evt_date, user, action, args
10731079 # 3|20170528045201.484|5|link|('issue', '5', 'blockedby')
10741080 linkcl , linkid , key = args
10751081 cls = self .db .getclass (linkcl )
10761082 # is the updated property quiet?
1077- if skipquiet and self .properties[key].quiet:
1078- logger.debug("skipping quiet property"
1079- " %s::%s in %s",
1080- self.classname, key, j_repr )
1083+ if skipquiet and cls .properties [key ].quiet :
1084+ logger .debug ("skipping quiet property: "
1085+ "%s %sed %s %s" ,
1086+ j_repr , action , self .classname , nodeid )
10811087 continue
1082- # property check on item we want history for
1088+ # can user view the property in linkee class
10831089 if enforceperm and not (perm ("View" ,
10841090 uid ,
1085- self.classname ,
1091+ linkcl ,
10861092 property = key ) or perm ("Edit" ,
10871093 uid ,
1088- self.classname ,
1094+ linkcl ,
10891095 property = key )):
1090- logger.debug("skipping unaccessible property %s::%s seen by user%s in %s",
1091- self.classname, key, uid, j_repr)
1096+ logger .debug ("skipping unaccessible property: "
1097+ "%s with uid %s %sed %s%s" ,
1098+ j_repr , uid , action ,
1099+ self .classname , nodeid )
10921100 continue
1093- # check on object linked
1101+ # check access to linkee object
10941102 if enforceperm and not (perm ("View" ,
10951103 uid ,
10961104 cls .classname ,
10971105 itemid = linkid ) or perm ("Edit" ,
10981106 uid ,
10991107 cls .classname ,
11001108 itemid = linkid )):
1101- logger.debug("skipping unaccessible target %s%s for user%s in %s",
1102- cls.classname, linkid, uid, j_repr)
1109+ logger .debug ("skipping unaccessible object: "
1110+ "%s uid %s %sed %s%s" ,
1111+ j_repr , uid , action ,
1112+ self .classname , nodeid )
11031113 continue
1104- '''
11051114 journal .append (j )
11061115 else :
11071116 logger .error ("Invalid %s journal entry for %s%s: %s" ,
0 commit comments