<div dir="ltr"><div dir="ltr">Hi Massimo,<div><br></div><div>You also need to set these detach policies</div><div><br></div><div><div class="gmail-syntax" style="background:rgb(240,240,240);color:rgb(0,0,0);font-family:"Trebuchet MS",sans-serif;font-size:15px"><pre style="margin-top:0px;margin-bottom:0px;padding:5px 0px;font-family:"Bitstream Vera Sans Mono",monospace;font-size:13px">"volume_extension:volume_admin_actions:force_detach"
"volume_extension:volume_actions:detach"
"volume_extension:volume_actions:begin_detaching"
"volume_extension:volume_actions:roll_detaching"</pre></div></div></div><div><br></div>Thanks and regards<div>Rajat Dhasmana<br><div class="gmail_quote"><div dir="ltr" class="gmail_attr"><br></div><div dir="ltr" class="gmail_attr">On Mon, Apr 27, 2020 at 4:22 PM Massimo Sgaravatto <<a href="mailto:massimo.sgaravatto@gmail.com">massimo.sgaravatto@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I would like to set a policy so that attachments operations can be done only by the user who created that volume. To do that I created this [*] policy.yaml file.<div><br><div>I verified that with such policy file:</div><div>-  I am able to attach volumes only for the volumes I created </div><div>- I can attach my volumes also to instances owned by other users</div><div>- I can not attach volumes belonging to other users to my instances</div><div><br></div><div>So far so good.</div><div><br></div><div>But I am allowed to detach any volume from any instance, even if I am not the owner of that volume, and this is not what I want</div><div><br></div><div>What am I doing wrong ?</div><div><br></div><div>Thanks, Massimo</div><div><div><br></div><div><br></div><div><br><div><br></div><div>[*]</div><div>#<br># To be used when another member of the same project can't change something<br># created by another user of the same project<br>"admin_or_user":  "is_admin:True or (role:admin and is_admin_project:True) or user_id:%(user_id)s"<br></div><div># Create attachment.<br># POST  /attachments<br>"volume:attachment_create": "rule:admin_or_user"<br><br># Update attachment.<br># PUT  /attachments/{attachment_id}<br>"volume:attachment_update": "rule:admin_or_user"<br><br># Delete attachment.<br># DELETE  /attachments/{attachment_id}<br>"volume:attachment_delete": "rule:admin_or_user"<br><br># Mark a volume attachment process as completed (in-use)<br># POST  /attachments/{attachment_id}/action (os-complete)<br>"volume:attachment_complete": "rule:admin_or_user"<br></div></div></div></div></div>
</blockquote></div></div></div>