diff --git a/atlas/views.py b/atlas/views.py index 3d8fbd7a..c4690349 100755 --- a/atlas/views.py +++ b/atlas/views.py @@ -3005,6 +3005,21 @@ class StructureAutocomplete(autocomplete.Select2QuerySetView): return Structure.objects.none() return qs + + def has_add_permission(self, request): + """Allow any authenticated user to create new Structure entries. + + By default DAL requires the user to have the model add permission. + For Anatomy question creation we want any registered user to be + able to create structures, so relax that check to only require + authentication. + """ + try: + auth = request.user.is_authenticated + except Exception: + auth = False + + return bool(auth) class SubspecialtyAutocomplete(autocomplete.Select2QuerySetView):