Issue link: https://read.uberflip.com/i/1334488
Chapter 5 121 # We get this new user's ID USER_ID=$(keystone user-list | awk ' / user / {print $2}') # We get the ID of the 'Member' role ROLE_ID=$(keystone role-list | awk ' / Member / {print $2}') # Finally add the user to the 'Member' role in cookbook keystone --token 999888777666 --endpoint http://172.16.0.1:35357/v2.0/ user-role-add --user $USER_ID --role $ROLE_ID --tenant_id $TENANT_ID 1. With our new user created, we will now create a container using a user that has admin privileges (and therefore a container that our new user initially doesn't have access to), as follows: swift -V 2.0 -A http://172.16.0.1:5000/v2.0/ -U cookbook:demo -K openstack post testACL 2. We will try to upload a file to this container using our new user, as follows: swift -V 2.0 -A http://172.16.0.1:5000/v2.0/ -U cookbook:user -K openstack upload testACL /tmp/test/test1 This brings back an HTTP 403 Forbidden message similar to the following: Object HEAD failed: https://172.16.0.2:443/v1/AUTH_53d87d9b6679490 4aa2c84c17274392b/testACL/tmp/test/test1 403 Forbidden 3. We will now give write access to the testACL container for our user by allowing them access to the Member role. swift -V 2.0 -A http://172.16.0.1:5000/v2.0/ -U cookbook:demo -K openstack post testACL -w Member -r Member 4. When we repeat the upload of the file, it now succeeds: swift -V 2.0 -A http://172.16.0.1:5000/v2.0/ -U cookbook:user -K openstack upload testACL /tmp/test/test1 www.it-ebooks.info

