diff --git a/journals/templatetags/lookup.py b/journals/templatetags/lookup.py index e262a10bf1911590174b222822388bf899d160bd..bdfeb24b0ce148daab9e22cc133a37abf5e7cc2a 100644 --- a/journals/templatetags/lookup.py +++ b/journals/templatetags/lookup.py @@ -21,3 +21,11 @@ class PublicationLookup(LookupChannel): return u"%s (%s)<br><span class='text-muted'>by %s</span>" % (item.title, item.doi_string, item.author_list) + + def check_auth(self, request): + """ + Check if current user has required permissions. + Right now only used for draft registration invitations. May be extended in the + future for other purposes as well. + """ + return request.user.has_perm('can_draft_registration_invitations') diff --git a/submissions/templatetags/lookup.py b/submissions/templatetags/lookup.py index 0c73d76071d7ac88453dc094807492ff4f6347f6..803edd8acbd338d2202c2c1666955ac082787673 100644 --- a/submissions/templatetags/lookup.py +++ b/submissions/templatetags/lookup.py @@ -20,3 +20,11 @@ class SubmissionLookup(LookupChannel): def format_match(self, item): '''(HTML) Format item for displaying in the dropdown.''' return u"%s<br><span class='text-muted'>by %s</span>" % (item.title, item.author_list) + + def check_auth(self, request): + """ + Check if current user has required permissions. + Right now only used for draft registration invitations. May be extended in the + future for other purposes as well. + """ + return request.user.has_perm('can_draft_registration_invitations')