diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/workflowengine/lib/Service/RuleMatcher.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/apps/workflowengine/lib/Service/RuleMatcher.php b/apps/workflowengine/lib/Service/RuleMatcher.php index 6186df1d7b9..57e3813c309 100644 --- a/apps/workflowengine/lib/Service/RuleMatcher.php +++ b/apps/workflowengine/lib/Service/RuleMatcher.php @@ -121,14 +121,16 @@ class RuleMatcher implements IRuleMatcher { $operations = array_merge($operations, $this->manager->getOperations($class, $scope)); } - $additionalScopes = $this->manager->getAllConfiguredScopesForOperation($class); - foreach ($additionalScopes as $hash => $scopeCandidate) { - /** @var ScopeContext $scopeCandidate */ - if ($scopeCandidate->getScope() !== IManager::SCOPE_USER || in_array($scopeCandidate, $scopes)) { - continue; - } - if ($this->entity->isLegitimatedForUserId($scopeCandidate->getScopeId())) { - $operations = array_merge($operations, $this->manager->getOperations($class, $scopeCandidate)); + if($this->entity instanceof IEntity) { + $additionalScopes = $this->manager->getAllConfiguredScopesForOperation($class); + foreach ($additionalScopes as $hash => $scopeCandidate) { + /** @var ScopeContext $scopeCandidate */ + if ($scopeCandidate->getScope() !== IManager::SCOPE_USER || in_array($scopeCandidate, $scopes)) { + continue; + } + if ($this->entity->isLegitimatedForUserId($scopeCandidate->getScopeId())) { + $operations = array_merge($operations, $this->manager->getOperations($class, $scopeCandidate)); + } } } |