Toloka documentation

set_user_restriction

toloka.client.TolokaClient.set_user_restriction | Source code

set_user_restriction(self, user_restriction: UserRestriction)

Restricts access to projects or pools for a Toloker.

Parameters Description

Parameters Type Description
user_restriction UserRestriction

Restriction parameters.

Examples:

If a Toloker often makes mistakes, we will restrict access to all our projects.

new_restriction = toloka_client.set_user_restriction(
    toloka.user_restriction.ProjectUserRestriction(
        user_id='1',
        private_comment='The Toloker often makes mistakes',
        project_id='5'
    )
)