async def apply_authorization(self, request): # User participation participation = IParticipation(request) # Lets extract the user from the request await participation() if participation.principal is not None: request.security.add(participation)
def test_participation(): principal = unauthenticated_principal participation = Participation(principal) assert IParticipation.providedBy(participation)
def test_participation(): principal = Principal('someone') participation = Participation(principal) assert IParticipation.providedBy(participation)