summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorblizzz <blizzz@arthur-schiwon.de>2019-12-18 11:09:12 +0100
committerGitHub <noreply@github.com>2019-12-18 11:09:12 +0100
commit47a4a037ae24180e80ec169b0f50438e63852507 (patch)
treed6e3300f8bd8968c71b9f107afe60dafa6d942d5
parent34c48aaa92a7ca39b16abb3ce3c0416c757e87ea (diff)
parent0a00903261425caac68fd95b996f3051e6776754 (diff)
downloadnextcloud-server-47a4a037ae24180e80ec169b0f50438e63852507.tar.gz
nextcloud-server-47a4a037ae24180e80ec169b0f50438e63852507.zip
Merge pull request #18461 from nextcloud/fix/noid/ensure-entity-on-scope-extension
Flows that are managing themselves do not necessarily set the entity
-rw-r--r--apps/workflowengine/lib/Service/RuleMatcher.php18
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));
+ }
}
}