ausocean / openfish

OpenFish is an open-source system written in GoLang for classifying marine species. Tasks involve importing video or image data, classifying and annotating data (both manually and automatically), searching, and more. It is expected that OpenFish will use utilize computer vision and machine learning techniques.
https://ausocean.github.io/openfish/
Other
6 stars 0 forks source link

Add role based access control #122

Closed scott97 closed 6 months ago

scott97 commented 7 months ago

Closes #115

Adds the concept of users to openfish. Users are identified by their email address. Users have one of 4 roles.

Admin role An admin would be able to add and remove annotations, videostreams, capturesources, users, and species.

Curator role A curator can select streams for classification. An application would be for teachers who could choose streams for their students to classify

Annotator role By default users would have the annotator role, which lets them add annotations, and delete their own annotations.

Readonly role A readonly user would only be able to look at annotations, not make any. This could be for unauthenticated users who only want to watch.

A new middleware - Guard is used to restrict access to APIs by user role. When ran locally (non-iap mode), role based access is disabled.

A new user API exists for managing users. New users cannot be created - a user is created when they log in for the first time. By default they are given the annotator role. The API supports:

The API is restricted for Admins only for now, we can change that later if needed.