Coverage for sites/ptf_tools/ptf_tools/utils.py: 100%

5 statements  

« prev     ^ index     » next       coverage.py v7.4.4, created at 2024-05-19 19:20 +0000

1from ptf_tools.templatetags.tools_helpers import get_authorized_collections 

2 

3 

4def is_authorized_editor(user, colid): 

5 colids = get_authorized_collections(user) 

6 is_authenticated = user.is_active and user.is_authenticated 

7 return is_authenticated and (colid in colids or user.is_staff)