Seção 4. Capítulo 3
single
Challenge: Access Control Decorator
Deslize para mostrar o menu
Tarefa
Swipe to start coding
Write a decorator called require_admin that restricts access to the decorated function. The function should only run if the global variable IS_ADMIN is True. If IS_ADMIN is not True, the decorator must raise a PermissionError. The decorator must work for any function it decorates.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 4. Capítulo 3
single
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo