Gerhard Schmidt
2018-11-11 12:24:50 UTC
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
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
--
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+***@googlegroups.com.
To post to this group, send email to pylons-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/46c5336e-ef8c-1ecc-d1c6-e900a461d545%40augusta.de.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pylons-discuss+***@googlegroups.com.
To post to this group, send email to pylons-***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pylons-discuss/46c5336e-ef8c-1ecc-d1c6-e900a461d545%40augusta.de.
For more options, visit https://groups.google.com/d/optout.