From 253cc1f683dfcfe75b1a5c1eb3a93f07e85bb041 Mon Sep 17 00:00:00 2001 From: Devin Carlen Date: Tue, 10 Aug 2010 18:46:49 -0700 Subject: Wired up admin api for user roles --- nova/endpoint/admin.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'nova/endpoint') diff --git a/nova/endpoint/admin.py b/nova/endpoint/admin.py index c4b8c05ca..a3114c0a3 100644 --- a/nova/endpoint/admin.py +++ b/nova/endpoint/admin.py @@ -102,6 +102,19 @@ class AdminController(object): return True + @admin_only + def describe_roles(self, context, project_roles=True, **kwargs): + """Returns a list of allowed roles.""" + return manager.AuthManager().get_roles(project_roles) + + @admin_only + def describe_user_roles(self, context, user, project=None, **kwargs): + """Returns a list of roles for the given user. + Omitting project will return any global roles that the user has. + Specifying project will return only project specific roles. + """ + return manager.AuthManager().get_user_roles(user, project=project) + @admin_only def modify_user_role(self, context, user, role, project=None, operation='add', **kwargs): -- cgit