Discussion:
Composable permissions question
Frank Bohnsack
2018-10-31 18:49:38 UTC
Permalink
While trying out the new composable permission feature, I have the
IsAuthenticated & IsStaff | IsAuthenticatedWithTwoFactor & IsCustomer
Traceback (most recent call last):
File "/usr/lib/python3.6/code.py", line 91, in runcode
exec(code, self.locals)
File "<console>", line 1, in <module>
TypeError: unsupported operand type(s) for |: 'OperandHolder' and
'OperandHolder'
It seems that is posible to compose like

(IsAuthenticated | IsStaff) & IsAuthenticatedWithTowFactor

but compose two composed permissions will not work :-(

Is it a feature or whats wrong in my code?

Regards
Frank
--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Xavier Ordoquy
2018-10-31 21:07:12 UTC
Permalink
Hi,

It’s more a bug in DRF.
Could you open an issue about that so we can keep it on our radars ?

Regards,
Xavier,
Linovia.
Post by Frank Bohnsack
IsAuthenticated & IsStaff | IsAuthenticatedWithTwoFactor & IsCustomer
File "/usr/lib/python3.6/code.py", line 91, in runcode
exec(code, self.locals)
File "<console>", line 1, in <module>
TypeError: unsupported operand type(s) for |: 'OperandHolder' and 'OperandHolder'
It seems that is posible to compose like
(IsAuthenticated | IsStaff) & IsAuthenticatedWithTowFactor
but compose two composed permissions will not work :-(
Is it a feature or whats wrong in my code?
Regards
Frank
--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
For more options, visit https://groups.google.com/d/optout <https://groups.google.com/d/optout>.
--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Frank Bohnsack
2018-10-31 21:55:01 UTC
Permalink
Will do so.

Regards
Frank
Post by Xavier Ordoquy
Hi,
It’s more a bug in DRF.
Could you open an issue about that so we can keep it on our radars ?
Regards,
Xavier,
Linovia.
IsAuthenticated & IsStaff | IsAuthenticatedWithTwoFactor & IsCustomer
File "/usr/lib/python3.6/code.py", line 91, in runcode
exec(code, self.locals)
File "<console>", line 1, in <module>
TypeError: unsupported operand type(s) for |: 'OperandHolder' and 'OperandHolder'
It seems that is posible to compose like
(IsAuthenticated | IsStaff) & IsAuthenticatedWithTowFactor
but compose two composed permissions will not work :-(
Is it a feature or whats wrong in my code?
Regards
Frank
--
You received this message because you are subscribed to the Google Groups
"Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...