<div dir="ltr"><div>Hi,</div><div><br></div><div>I was trying to fine tune some keystone policy rules. Basically I want to grant "create_project" action to user in "ops" role. And following are my steps.</div>

<div><br></div><div>1. Adding a new user "usr1"</div><div>2. Creating new role "ops"</div><div>3. Granting this user a "ops" role in "service" tenant</div><div>4. Adding new lines to keystone policy file</div>

<div><br></div><div><div>        "ops_required": [["role:ops"]],</div><div>        "admin_or_ops": [["rule:admin_required"], ["rule:ops_required"]],</div></div><div><br></div>

<div>5. Change</div><div><br></div><div>        "identity:create_project": [["rule:admin_required"]],</div><div>    to</div><div>        "identity:create_project": [["rule:admin_or_ops"]],<br>

</div><div><br></div><div>6. Restart keystone service</div><div><br></div><div>keystone tenant-create with credential of user "usr1" still returns 403 Forbidden error.</div><div>“You are not authorized to perform the requested action, admin_required. (HTTP 403)”<br>

</div><div><br></div><div>After some quick scan, it seems that create_project function has a hard-coded assert_admin call[1], which does not respect settings in the policy file.</div><div><br></div><div>Any ideas why? Is it a bug to fix? Thanks!</div>

<div>BTW, I'm running keystone havana release with V2 API.</div><div><br></div><div>[1] <a href="https://github.com/openstack/keystone/blob/master/keystone/identity/controllers.py#L105">https://github.com/openstack/keystone/blob/master/keystone/identity/controllers.py#L105</a><br>

</div><div><br></div><div>Thanks,</div><div>--<br>Qiu Yu</div>
</div>