Due to a default Keystone policy until Newtown,
and the use of resource_find, non-admins are unable
to list their own projects.
This patch bypasses this problem while also introducing better
UX for non-admins wishing to get their project list.
'openstack project list' retains the default of 'list all projects'
but on a forbidden error will default instead to 'list my projects'.
This way for non-admins 'list my projects' feels like the default
without breaking the expected admin default.
Adding the '--my-projects' option allows admins to easily list their
own projects or allows non-admins to be explicit and bypass the
forbidden error fallback.
Reviewed: https:/ /review. openstack. org/376056 /git.openstack. org/cgit/ openstack/ python- openstackclient /commit/ ?id=49f6032b699 804b1b0ed56137a b14ba266251157
Committed: https:/
Submitter: Jenkins
Branch: master
commit 49f6032b699804b 1b0ed56137ab14b a266251157
Author: adrian-turjak <email address hidden>
Date: Mon Sep 26 13:06:42 2016 +1300
Non-Admin can't list own projects
Due to a default Keystone policy until Newtown,
and the use of resource_find, non-admins are unable
to list their own projects.
This patch bypasses this problem while also introducing better
UX for non-admins wishing to get their project list.
'openstack project list' retains the default of 'list all projects'
but on a forbidden error will default instead to 'list my projects'.
This way for non-admins 'list my projects' feels like the default
without breaking the expected admin default.
Adding the '--my-projects' option allows admins to easily list their
own projects or allows non-admins to be explicit and bypass the
forbidden error fallback.
Change-Id: I1021276f69fbbf 28e13e17c4e567d 932fce7ed8b
Closes-Bug: #1627555