Add policy support

Using oslo.policy to support access control for Distil API
access, which will follow the community way.

Change-Id: I670d9fde4f5c368e82c26b512b7c1e46c2e380ec
This commit is contained in:
Fei Long Wang
2016-06-17 16:20:29 +12:00
parent 6c69d161e9
commit 09b03931eb
12 changed files with 275 additions and 119 deletions

8
etc/policy.json.sample Normal file
View File

@@ -0,0 +1,8 @@
{
"context_is_admin": "role:admin",
"admin_or_owner": "is_admin:True or project_id:%(project_id)s",
"default": "rule:admin_or_owner",
"rating:costs:get": "rule:context_is_admin",
"rating:usages:get": "rule:context_is_admin",
}