Thanks for the tip, Galen! The eval {} was me floundering for something like a try-catch because I'm new to perl. Ref is a much better way to check the same thing.
I rebased my branch closer to main, made the the Survey.pm fix less jank, and then did some testing to make sure it still worked. I think I did stronger testing this time, because I found more issues around permissions with surveys in general.
For example: The Owning Library org-select on the 'Edit Survey' tab never filled with anything if you didn't have ADMIN_SURVEY because it wasn't looking for UPDATE_SURVEY. You couldn't save changes to the dates or name of a survey without ADMIN_SURVEY for the same reason.
All fixed by adding the non-admin perms to the fieldmapper.
I also added UPDATE_USER as an option to take survey responses. The code looked like you might only be able to save responses if you had ADMIN_SURVEY before, but I didn't check. Now it should be possible to let circulators take responses without also being able to change the surveys themselves.
Thanks for the tip, Galen! The eval {} was me floundering for something like a try-catch because I'm new to perl. Ref is a much better way to check the same thing.
I rebased my branch closer to main, made the the Survey.pm fix less jank, and then did some testing to make sure it still worked. I think I did stronger testing this time, because I found more issues around permissions with surveys in general.
For example: The Owning Library org-select on the 'Edit Survey' tab never filled with anything if you didn't have ADMIN_SURVEY because it wasn't looking for UPDATE_SURVEY. You couldn't save changes to the dates or name of a survey without ADMIN_SURVEY for the same reason.
All fixed by adding the non-admin perms to the fieldmapper.
I also added UPDATE_USER as an option to take survey responses. The code looked like you might only be able to save responses if you had ADMIN_SURVEY before, but I didn't check. Now it should be possible to let circulators take responses without also being able to change the surveys themselves.
Branch: https:/ /git.evergreen- ils.org/ ?p=working/ Evergreen. git;a=shortlog; h=refs/ heads/user/ smayo/lp1910444 -Survey_ Permissions_ Prevent_ Adding_ Questions_ rebase