Roundup Tracker - Issues

Message8167

Author schlatterbeck
Recipients rouilj, schlatterbeck
Date 2024-10-24.07:25:00
Message-id <20241024072457.3lblqwxrcebwhjtt@runtux.com>
In-reply-to <20241023171436.54ED26A01A3@pe15.cs.umb.edu>
On Wed, Oct 23, 2024 at 05:14:45PM +0000, John Rouillard wrote:
> >> Then you added a test:
> >> 
> >>       if self.properties is None:
> >>           return 1
> >> 
> >> that used to be handled by fall through to the return 1 at the end of
> >> the method. I think "not self._properties_dict[property]" would be
> >> False for every property if self.properties is None.
> >
> >The check should not fail if the permission does not define *any*
> >properties. In that case the _properties_dict is {None: True} and the
> >test
> >    if not self._properties_dict[property]
> >fails. I have no idea why this ever worked.

Ah. I was debugging the failing liveserver test when I made that change.
And of course I didn't understand what TruthDict does at the time.
The symptom was that admin didn't have any permission (and the admin
permissions also lack a classname in addition to lacking properties).
Turns out I needed to check for an empty class, too, in Role.searchable.

At the time I was still trying to find out what the failing test was
supposed to do -- by unfortunate coincidence it was just that test that
caught a bug in my refactoring of permissions :-)

I've reverted that change and added a comment.

Ralf
-- 
Dr. Ralf Schlatterbeck                  Tel:   +43/2243/26465-16
Open Source Consulting                  www:   www.runtux.com
Reichergasse 131, A-3411 Weidling       email: office@runtux.com
History
Date User Action Args
2024-10-24 07:25:01schlatterbecksetrecipients: + schlatterbeck, rouilj
2024-10-24 07:25:01schlatterbecklinkissue2551330 messages
2024-10-24 07:25:00schlatterbeckcreate