CCI-MOC / hil

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

Add list_users (admin operation) #945

Closed xuhang57 closed 6 years ago

xuhang57 commented 6 years ago

This patch adds a new API called list_users. It is an admin operation and lists all users in the database.

This is a work in progress This relates to https://github.com/CCI-MOC/hil/issues/943

xuhang57 commented 6 years ago

Stil thinking on how to format the return result and the content too.

(.venv) ubuntu@lucas-hil:~/hil$ hil list_users
lucas-admin      : {u'is_admin': True, u'id': 4}
lucas-test   : {u'is_admin': False, u'id': 3}
hil      : {u'is_admin': True, u'id': 1}
lucas    : {u'is_admin': False, u'id': 2}
naved001 commented 6 years ago

I think the user id isn't helpful. In addition to privilege, you could print a list of projects they have access to.

ianballou commented 6 years ago

I think keeping the format like list_networks works out ok (like what you posted above): $ hil list_networks $ networky : {u'network_id': u'gi/1/0/1', u'projects': [u'tester']}

xuhang57 commented 6 years ago

@naved001 @Izhmash @Izhmash done.

xuhang57 commented 6 years ago

@zenhack @Linzertorte @naved001 done

zenhack commented 6 years ago

I'm happy.