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
opinions= []
# Every plugin is consulted for their opinionforcheckinpm.hook.permission_allowed(
datasette=self,
actor=actor,
action=action,
resource=resource,
):
check=awaitawait_me_maybe(check)
ifcheckisnotNone:
opinions.append(check)
result=None# If any plugin said False it's false - the veto ruleifany(notrforrinopinions):
result=Falseelifany(rforrinopinions):
# Otherwise, if any plugin said True it's trueresult=True
For easier debugging of complex situations (where more than one plugin might have contributed an opinion) I'd like to be able to tell which plugin returned which values.
Is there a way I can do this with Pluggy? If not, could I request it as a feature?
The text was updated successfully, but these errors were encountered:
I have some code that looks like this:
This is for a plugin-based permission model.
For easier debugging of complex situations (where more than one plugin might have contributed an opinion) I'd like to be able to tell which plugin returned which values.
Is there a way I can do this with Pluggy? If not, could I request it as a feature?
The text was updated successfully, but these errors were encountered: