I addressed the same problem on the public networks branch in gerrit in WIP at the moment while we finalize decision on how it should look like on public API.<div><br></div><div>Let me know your thoughts about the implementation. If that is good for you, we can just use that.</div>
<div>Otherwise, I'll be extremely happy to address all your comments :)</div><div><br></div><div>You've already done such a lot of great work, that I think it's time for me to address some real issues as well!</div>
<div><br></div><div>Salvatore<br><br><div class="gmail_quote">On 23 July 2012 19:58, Robert Kukura <span dir="ltr"><<a href="mailto:rkukura@redhat.com" target="_blank">rkukura@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">Given that Salvatore and Sumit were both concerned about the plugins<br>
</div>doing the authorization for provider network extended attributes (see<br>
patch set 5 of <a href="https://review.openstack.org/#/c/9069/" target="_blank">https://review.openstack.org/#/c/9069/</a>), I've been<br>
working on a very simple mechanism to move those policy checks into the<br>
core. This mechanism can be used for core attributes as well as extended<br>
attributes that require specific authorization to be set or viewed.<br>
<br>
The resource attributes map (see quantum/api/v2/attributes.py) currently<br>
<div class="im">has boolean properties called allow_post, allow_put, and is_visible that<br>
control whether an attribute can be set via create, set via update, or<br>
</div>viewed, respectively. My proposed approach is that each of these three<br>
<div class="im">properties can still be a boolean, but if it is instead a string, that<br>
string is passed to the policy.check function as the name of an action,<br>
</div>and the result of the check is used as the boolean would have been used.<br>
<div class="im"><br>
Please let me know ASAP whether or not you feel this approach is<br>
acceptable, or if you've got any questions or better (simple) ideas. I<br>
</div>hope to have it implemented and included in the next provider-network BP<br>
patch later today.<br>
<br>
Thanks,<br>
<br>
-Bob<br>
</blockquote></div><br></div>