Update Glance sample policy file

Sample policy file is out of sync with Glance repo; we should update it
to make dev/deployer work easier.

Change-Id: I4891e13a387729660e43f476796731937da0aa6e
This commit is contained in:
Rob Cresswell 2016-10-04 14:17:42 +01:00
parent 7f47b1baec
commit 8ce6e6c343
2 changed files with 21 additions and 12 deletions

View File

@ -1,14 +1,13 @@
{
"context_is_admin": "role:admin",
"admin_or_owner": "is_admin:True or project_id:%(project_id)s",
"default": "rule:admin_or_owner",
"default": "role:admin",
"add_image": "",
"delete_image": "rule:admin_or_owner",
"delete_image": "",
"get_image": "",
"get_images": "",
"modify_image": "rule:admin_or_owner",
"publicize_image": "",
"modify_image": "",
"publicize_image": "role:admin",
"copy_from": "",
"download_image": "",
@ -26,16 +25,18 @@
"manage_image_cache": "role:admin",
"get_task": "",
"get_tasks": "",
"add_task": "",
"modify_task": "",
"get_task": "role:admin",
"get_tasks": "role:admin",
"add_task": "role:admin",
"modify_task": "role:admin",
"deactivate": "",
"reactivate": "",
"get_metadef_namespace": "",
"get_metadef_namespaces":"",
"modify_metadef_namespace":"",
"add_metadef_namespace":"",
"delete_metadef_namespace":"",
"get_metadef_object":"",
"get_metadef_objects":"",
@ -43,10 +44,18 @@
"add_metadef_object":"",
"list_metadef_resource_types":"",
"get_metadef_resource_type":"",
"add_metadef_resource_type_association":"",
"get_metadef_property":"",
"get_metadef_properties":"",
"modify_metadef_property":"",
"add_metadef_property":""
"add_metadef_property":"",
"get_metadef_tag":"",
"get_metadef_tags":"",
"modify_metadef_tag":"",
"add_metadef_tag":"",
"add_metadef_tags":""
}

View File

@ -57,7 +57,7 @@ class DeleteNamespace(tables.DeleteAction):
count
)
policy_rules = (("image", "delete_metadef_namespace"),)
policy_rules = (("image", "modify_metadef_namespace"),)
def allowed(self, request, namespace=None):
# Protected namespaces can not be deleted.