WildAid / o-fish-web

Web application for the Officer's Fishery Information Sharing Hub (O-FISH). The web app allows agencies to gain insights from the aggregated information gathered during a routine vessel inspection (submitted via the web app).
Apache License 2.0
31 stars 41 forks source link

Field Officer New User permissions #220

Closed o-fish-wildaid closed 3 years ago

o-fish-wildaid commented 3 years ago

Field officers can change their URL to https://instance/#/users/new_user - they should get an 'Not authorized' page such as when the field officer tries to go to #/agencies

stennie commented 3 years ago

I would like to work on this issue

Sheeri commented 3 years ago

Hello @stennie, thanks for offering to work on this! I have assigned it to you.

stennie commented 3 years ago

@Sheeri According to the O-FISH Sandbox Guide I should be able to create new field officer users with my dev agency account.

When I login with my sandbox agency test account and attempt to create a user I'm encountering a non-obvious error. I tried locally first, and then via https://wildaidsandbox-mxgfy.mongodbstitch.com/#/users/new_user.

I end up with an empty error message box and the Chrome console shows a resource failed to load with an HTTP 409 error ("Resource conflict"):

create-field-officer-error

Do I need to stand up my own test instance or should this be working? Should I raise an issue for the uncaught error message?

Thanks, Stennie

Sheeri commented 3 years ago

Hi @stennie!

Thanks for catching this - I found the error the other day and attempted to fix it with https://github.com/WildAid/o-fish-realm/pull/172 - I had tested it in the sandbox server, so thought it was working. Andrew fixed the "rules" component and I hadn't changed the sandbox server back.

It should be working now; can you give it a try please? Thanks!

stennie commented 3 years ago

Thanks @Sheeri! User creation in the sandbox is working for me now 👍

Sheeri commented 3 years ago

Woo woo! Closing this issue as it's working for you now.

stennie commented 3 years ago

@Sheeri I was going to suggest reopening this since the sandbox fix only let me progress testing the issue.

However, it seems the permission check was already added by way of 6d897b64 so there's nothing to do for this issue 👍

Regards, Stennie