Small bug in DummySecurityPolicy

13 views
Skip to first unread message

Gerhard Schmidt

unread,
Nov 11, 2018, 7:25:20 AM11/11/18
to pylons-discuss
Hi,

I'm doing some tests writing for an project of mine and come to testing
permissions. I use DummySecurityPolicy in most of my tests to speedup
testing. But there is a small problem with the code.

DummySecurityPolicy.principals_allowed_by_permission() returns always
the result of DummySecurityPolicy.effective_principals() regardless if
permissive is True or False.

It should return [] if permissive is set to False.

So the code should look like this.

def principals_allowed_by_permission(self, context, permission):
if self.permissive:
return self.effective_principals(None)
else:
return []

Regards
Estartu

signature.asc

Steve Piercy

unread,
Nov 14, 2018, 8:48:36 AM11/14/18
to pylons-...@googlegroups.com
Please submit an issue or pull request.
https://github.com/Pylons/pyramid/issues/new/choose

--steve


On 11/11/18 at 1:24 PM, est...@augusta.de (Gerhard Schmidt) pronounced:
------------------------
Steve Piercy, Eugene, OR

Reply all
Reply to author
Forward
0 new messages