CCI-MOC / hil

Hardware Isolation Layer, formerly Hardware as a Service
Apache License 2.0
24 stars 54 forks source link

An API to list all HIL users with their priveleges #943

Closed naved001 closed 6 years ago

naved001 commented 6 years ago

When using the database auth backend, it would be nice to know what users exists and what are their privileges.

I find myself looking into the db to check if I made an account on HIL for someone.

xuhang57 commented 6 years ago

So a function called list_users and the return value should be {"username": "naved", "privileges": "admin"} ?

querying the User model should give us back enough information right?

zenhack commented 6 years ago

I'm always a little uncozy adding backend-specific calls, but I suppose we already have a few for the database backend, and I can see that this is a big hole in the API.

This could just be a GET on /auth/basic/user.

It might be nice to also be able to list the projects a user is in.

xuhang57 commented 6 years ago

agree.

So having a GET ON /auth/basic/user and the api function called: list_users which needs the Admin privilege.

The return value is {"username": "naved", "project": "naved-project", "privileges": "admin"}

@naved001 thoughts?

naved001 commented 6 years ago

Yep, keep in mind a user could have access to multiple projects. And admins can access every project. So gotta think how we will package the response.

xuhang57 commented 6 years ago

Closing this.