'Get a list of roles.
By default a listing of all roles are returned.
If the GET parameters project_id and user_id are specified then that
user\'s roles for that project are returned. If user_id is \'current\'
then the current user\'s roles for that project are returned.
The listing result is an object with property "items".'

@rest_utils.ajax()
def get(self, request):

    project_id = request.GET.get('project_id')
    user_id = request.GET.get('user_id')
    if (project_id and user_id):
        if (user_id == 'current'):
            user_id = request.user.id
        roles = (api.keystone.roles_for_user(request, user_id, project_id) or [])
        items = [r.to_dict() for r in roles]
    else:
        items = [r.to_dict() for r in api.keystone.role_list(request)]
    return {'items': items}
