You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to declare a permission whose .can() method always returns False (background: it's returned from a factory function and the meaning is that some objects may not be edited/removed by anyone).
There are a couple of ways to do this:
subclass Permission and override the method;
crate a Need that is shared by all identites and return a permission that excludes it.
I prefer the need-based method because it retains the ability to perform permission algebra with the new permission. So then, how to add this need to the AnonymousIdentity? How about we define a Principal.get_default_identity method that subclasses can override?
The text was updated successfully, but these errors were encountered:
I'd like to declare a permission whose
.can()
method always returnsFalse
(background: it's returned from a factory function and the meaning is that some objects may not be edited/removed by anyone).There are a couple of ways to do this:
Permission
and override the method;Need
that is shared by all identites and return a permission that excludes it.I prefer the need-based method because it retains the ability to perform permission algebra with the new permission. So then, how to add this need to the
AnonymousIdentity
? How about we define aPrincipal.get_default_identity
method that subclasses can override?The text was updated successfully, but these errors were encountered: