mirror of
https://github.com/adrigongv23/G26---Telemetry-Software.git
synced 2026-08-25 11:33:17 +02:00
Gestión usuarios añadida
This commit is contained in:
parent
319a95cc91
commit
97d38a086c
8 changed files with 284 additions and 3 deletions
7
Plataform_Web/users/decorators.py
Normal file
7
Plataform_Web/users/decorators.py
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
from django.contrib.auth.decorators import login_required, user_passes_test
|
||||
|
||||
|
||||
def require_rol(*roles):
|
||||
def decorator(view_func):
|
||||
return login_required(user_passes_test(lambda u: u.rol in roles)(view_func))
|
||||
return decorator
|
||||
Loading…
Add table
Add a link
Reference in a new issue