(*args, **kwds)
| 24 | def wrapper(func): |
| 25 | @wraps(func) |
| 26 | def inner(*args, **kwds): |
| 27 | |
| 28 | with sessionMaker.session_scope() as session: |
| 29 | |
| 30 | if LoggedIn() != True: |
| 31 | raise Unauthorized("No access.") |
| 32 | |
| 33 | user = session.query(User).filter(User.id == getUserID(session = session)).first() |
| 34 | |
| 35 | if user is None: |
| 36 | raise Unauthorized("No access.") |
| 37 | |
| 38 | if allow_support is True: |
| 39 | if user.is_support_user() is True: |
| 40 | return func(*args, **kwds) |
| 41 | |
| 42 | if user.is_super_admin == True: |
| 43 | return func(*args, **kwds) |
| 44 | else: |
| 45 | raise Forbidden("No access.") |
| 46 | |
| 47 | raise Forbidden("No access.") |
| 48 | |
| 49 | return inner |
| 50 |
nothing calls this directly
no test coverage detected