コード例 #1
0
 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)
コード例 #2
0
def test_participation():
    principal = unauthenticated_principal
    participation = Participation(principal)
    assert IParticipation.providedBy(participation)
コード例 #3
0
def test_participation():
    principal = Principal('someone')
    participation = Participation(principal)
    assert IParticipation.providedBy(participation)