summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--heat/engine/stack.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/heat/engine/stack.py b/heat/engine/stack.py
index e0bfe0bec..2bb7cb238 100644
--- a/heat/engine/stack.py
+++ b/heat/engine/stack.py
@@ -822,11 +822,11 @@ class Stack(collections.Mapping):
def access_allowed(self, credential_id, resource_name):
"""Is credential_id authorised to access resource by resource_name."""
- if not self.resources:
- # this also triggers lazy-loading of resources
- # so is required for register_access_allowed_handler
- # to be called
- return False
+ if not self.resources or resource_name not in self.resources:
+ # this handle the case that sd in action delete,
+ # try to load access_allowed_handlers if resources object
+ # haven't been loaded.
+ [res.name for res in self.iter_resources()]
handler = self._access_allowed_handlers.get(credential_id)
return handler and handler(resource_name)