]> granicus.if.org Git - icinga2/commitdiff
use current frame scope for permission filter function calls
authorElias Ohm <eohm@novomind.com>
Thu, 2 May 2019 05:35:19 +0000 (07:35 +0200)
committerMichael Friedrich <michael.friedrich@icinga.com>
Thu, 16 May 2019 14:16:58 +0000 (16:16 +0200)
(cherry picked from commit 53febdea819adf58b20a0141e1a1131658f1338c)

lib/remote/filterutility.cpp

index 8a7605ad8accba75b5196b4fddca9582c0d8253a..255bb96c6cf28af4465d85d26026234891997a44 100644 (file)
@@ -173,7 +173,7 @@ void FilterUtility::CheckPermission(const ApiUser::Ptr& user, const String& perm
 
                        if (filter && permissionFilter) {
                                std::vector<std::unique_ptr<Expression> > args;
-                               args.emplace_back(new GetScopeExpression(ScopeLocal));
+                               args.emplace_back(new GetScopeExpression(ScopeThis));
                                std::unique_ptr<Expression> indexer{new IndexerExpression(std::unique_ptr<Expression>(MakeLiteral(filter)), std::unique_ptr<Expression>(MakeLiteral("call")))};
                                FunctionCallExpression *fexpr = new FunctionCallExpression(std::move(indexer), std::move(args));