Commit e47cb7f9 authored by Jérome Perrin's avatar Jérome Perrin

ERP5Type: consider security on reference property when computing compact title

This is only meaningful if reference is protected.

I don't know if this is really a use case ... testGUIwithSecurity does
this, but this is not a realistic situation. Maybe it should test
another permission.
parent 462b89ed
......@@ -2414,7 +2414,7 @@ class Base( CopyContainer,
r = self.getShortTitle()
if r: return r
return (getattr(self, '_baseGetTitle', str)() or
self.getProperty('reference') or
self.getProperty('reference', checked_permission=Permissions.AccessContentsInformation) or
self.getId())
security.declareProtected(Permissions.AccessContentsInformation,
......@@ -2447,7 +2447,7 @@ class Base( CopyContainer,
return (# No need to test existence since all Base instances have this method
# Also useful whenever title is calculated
self._baseGetTranslatedTitle() or
self.getProperty('reference') or
self.getProperty('reference', checked_permission=Permissions.AccessContentsInformation) or
self.getId())
# This method allows to sort objects in list is a more reasonable way
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment