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", "context_is_admin": "role:admin",
"admin_or_owner": "is_admin:True or project_id:%(project_id)s", "default": "role:admin",
"default": "rule:admin_or_owner",
"add_image": "", "add_image": "",
"delete_image": "rule:admin_or_owner", "delete_image": "",
"get_image": "", "get_image": "",
"get_images": "", "get_images": "",
"modify_image": "rule:admin_or_owner", "modify_image": "",
"publicize_image": "", "publicize_image": "role:admin",
"copy_from": "", "copy_from": "",
"download_image": "", "download_image": "",
@ -26,16 +25,18 @@
"manage_image_cache": "role:admin", "manage_image_cache": "role:admin",
"get_task": "", "get_task": "role:admin",
"get_tasks": "", "get_tasks": "role:admin",
"add_task": "", "add_task": "role:admin",
"modify_task": "", "modify_task": "role:admin",
"deactivate": "",
"reactivate": "",
"get_metadef_namespace": "", "get_metadef_namespace": "",
"get_metadef_namespaces":"", "get_metadef_namespaces":"",
"modify_metadef_namespace":"", "modify_metadef_namespace":"",
"add_metadef_namespace":"", "add_metadef_namespace":"",
"delete_metadef_namespace":"",
"get_metadef_object":"", "get_metadef_object":"",
"get_metadef_objects":"", "get_metadef_objects":"",
@ -43,10 +44,18 @@
"add_metadef_object":"", "add_metadef_object":"",
"list_metadef_resource_types":"", "list_metadef_resource_types":"",
"get_metadef_resource_type":"",
"add_metadef_resource_type_association":"", "add_metadef_resource_type_association":"",
"get_metadef_property":"", "get_metadef_property":"",
"get_metadef_properties":"", "get_metadef_properties":"",
"modify_metadef_property":"", "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 count
) )
policy_rules = (("image", "delete_metadef_namespace"),) policy_rules = (("image", "modify_metadef_namespace"),)
def allowed(self, request, namespace=None): def allowed(self, request, namespace=None):
# Protected namespaces can not be deleted. # Protected namespaces can not be deleted.