From 8e5961f217742a035aff3b42d122252040c881a8 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Thu, 18 Aug 2016 19:00:14 +0200 Subject: [PATCH] Fix missing permissions and update the documentation fixes #12483 --- doc/12-icinga2-api.md | 7 +++++-- lib/remote/typequeryhandler.cpp | 1 + lib/remote/variablequeryhandler.cpp | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/12-icinga2-api.md b/doc/12-icinga2-api.md index 8c29b554e..9f18a2d8f 100644 --- a/doc/12-icinga2-api.md +++ b/doc/12-icinga2-api.md @@ -203,13 +203,16 @@ Available permissions for specific URL endpoints: actions/<action> | /v1/actions | Yes config/query | /v1/config | No config/modify | /v1/config | No + console | /v1/console | No + events/<type> | /v1/events | No objects/query/<type> | /v1/objects | Yes objects/create/<type> | /v1/objects | No objects/modify/<type> | /v1/objects | Yes objects/delete/<type> | /v1/objects | Yes status/query | /v1/status | Yes - events/<type> | /v1/events | No - console | /v1/console | No + templates/<type> | /v1/templates | Yes + types | /v1/types | Yes + variables | /v1/variables | Yes The required actions or types can be replaced by using a wildcard match ("\*"). diff --git a/lib/remote/typequeryhandler.cpp b/lib/remote/typequeryhandler.cpp index b93d67f2b..c76cc32f8 100644 --- a/lib/remote/typequeryhandler.cpp +++ b/lib/remote/typequeryhandler.cpp @@ -74,6 +74,7 @@ bool TypeQueryHandler::HandleRequest(const ApiUser::Ptr& user, HttpRequest& requ QueryDescription qd; qd.Types.insert("Type"); + qd.Permission = "types"; qd.Provider = new TypeTargetProvider(); if (params->Contains("type")) diff --git a/lib/remote/variablequeryhandler.cpp b/lib/remote/variablequeryhandler.cpp index 33888b6c5..37409eccd 100644 --- a/lib/remote/variablequeryhandler.cpp +++ b/lib/remote/variablequeryhandler.cpp @@ -83,6 +83,7 @@ bool VariableQueryHandler::HandleRequest(const ApiUser::Ptr& user, HttpRequest& QueryDescription qd; qd.Types.insert("Variable"); + qd.Permission = "variables"; qd.Provider = new VariableTargetProvider(); params->Set("type", "Variable"); -- 2.40.0