From 571162f7d17d91b60a8367988245dac9432e8a0f Mon Sep 17 00:00:00 2001 From: Wontek Hong Date: Thu, 12 Oct 2023 11:57:35 +0200 Subject: [PATCH] openapi: change mkeventd and bi Perm to OkayToIgnorePerm for non event_console and bi endpoints Change-Id: I129cb29e07e53c3489cd6d6d3ae5832739bcd1af --- .../endpoints/acknowledgement/__init__.py | 4 ++-- .../endpoints/activate_changes/__init__.py | 4 ++-- cmk/gui/openapi/endpoints/bi/__init__.py | 2 +- cmk/gui/openapi/endpoints/comment/__init__.py | 4 ++-- cmk/gui/openapi/endpoints/downtime/__init__.py | 4 ++-- .../openapi/endpoints/event_console/__init__.py | 2 +- cmk/gui/openapi/endpoints/host/__init__.py | 4 ++-- .../openapi/endpoints/host_config/__init__.py | 16 ++++++++-------- cmk/gui/openapi/endpoints/service/__init__.py | 4 ++-- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/cmk/gui/openapi/endpoints/acknowledgement/__init__.py b/cmk/gui/openapi/endpoints/acknowledgement/__init__.py index c5d76cc3b31..347be8b8d88 100644 --- a/cmk/gui/openapi/endpoints/acknowledgement/__init__.py +++ b/cmk/gui/openapi/endpoints/acknowledgement/__init__.py @@ -53,8 +53,8 @@ permissions.AnyPerm( [ permissions.Perm("general.see_all"), - permissions.Perm("bi.see_all"), - permissions.Perm("mkeventd.seeall"), + permissions.OkayToIgnorePerm("bi.see_all"), + permissions.OkayToIgnorePerm("mkeventd.seeall"), permissions.Perm("wato.see_all_folders"), ] ) diff --git a/cmk/gui/openapi/endpoints/activate_changes/__init__.py b/cmk/gui/openapi/endpoints/activate_changes/__init__.py index ec20b2f6ad8..d89a19b17b7 100644 --- a/cmk/gui/openapi/endpoints/activate_changes/__init__.py +++ b/cmk/gui/openapi/endpoints/activate_changes/__init__.py @@ -57,8 +57,8 @@ permissions.AnyPerm( [ permissions.Perm("general.see_all"), - permissions.Perm("bi.see_all"), - permissions.Perm("mkeventd.seeall"), + permissions.OkayToIgnorePerm("bi.see_all"), + permissions.OkayToIgnorePerm("mkeventd.seeall"), ] ), ) diff --git a/cmk/gui/openapi/endpoints/bi/__init__.py b/cmk/gui/openapi/endpoints/bi/__init__.py index 002c9d5a84d..e7b406aa604 100644 --- a/cmk/gui/openapi/endpoints/bi/__init__.py +++ b/cmk/gui/openapi/endpoints/bi/__init__.py @@ -92,7 +92,7 @@ class BIRuleEndpointSchema(BIRuleSchema): [ permissions.Perm("bi.see_all"), permissions.Perm("general.see_all"), - permissions.Perm("mkeventd.seeall"), + permissions.OkayToIgnorePerm("mkeventd.seeall"), ] ) ), diff --git a/cmk/gui/openapi/endpoints/comment/__init__.py b/cmk/gui/openapi/endpoints/comment/__init__.py index d4591ce6cd9..f066bf992d6 100644 --- a/cmk/gui/openapi/endpoints/comment/__init__.py +++ b/cmk/gui/openapi/endpoints/comment/__init__.py @@ -58,8 +58,8 @@ permissions.AnyPerm( [ permissions.Perm("general.see_all"), - permissions.Perm("bi.see_all"), - permissions.Perm("mkeventd.seeall"), + permissions.OkayToIgnorePerm("bi.see_all"), + permissions.OkayToIgnorePerm("mkeventd.seeall"), permissions.Undocumented(permissions.Perm("wato.see_all_folders")), ] ) diff --git a/cmk/gui/openapi/endpoints/downtime/__init__.py b/cmk/gui/openapi/endpoints/downtime/__init__.py index f0f7190b881..d2eb879190d 100644 --- a/cmk/gui/openapi/endpoints/downtime/__init__.py +++ b/cmk/gui/openapi/endpoints/downtime/__init__.py @@ -99,8 +99,8 @@ permissions.AnyPerm( [ permissions.Perm("general.see_all"), - permissions.Perm("bi.see_all"), - permissions.Perm("mkeventd.seeall"), + permissions.OkayToIgnorePerm("bi.see_all"), + permissions.OkayToIgnorePerm("mkeventd.seeall"), permissions.Perm("wato.see_all_folders"), ] ) diff --git a/cmk/gui/openapi/endpoints/event_console/__init__.py b/cmk/gui/openapi/endpoints/event_console/__init__.py index c5cb1b2d0ee..8fc9144c4bb 100644 --- a/cmk/gui/openapi/endpoints/event_console/__init__.py +++ b/cmk/gui/openapi/endpoints/event_console/__init__.py @@ -67,7 +67,7 @@ [ permissions.Perm("mkeventd.seeall"), permissions.Perm("general.see_all"), - permissions.Perm("bi.see_all"), + permissions.OkayToIgnorePerm("bi.see_all"), ] ) ) diff --git a/cmk/gui/openapi/endpoints/host/__init__.py b/cmk/gui/openapi/endpoints/host/__init__.py index 540094ef353..c04c9251c7c 100644 --- a/cmk/gui/openapi/endpoints/host/__init__.py +++ b/cmk/gui/openapi/endpoints/host/__init__.py @@ -89,8 +89,8 @@ class SingleHostParameters(BaseSchema): permissions.AnyPerm( [ permissions.Perm("general.see_all"), - permissions.Perm("bi.see_all"), - permissions.Perm("mkeventd.seeall"), + permissions.OkayToIgnorePerm("bi.see_all"), + permissions.OkayToIgnorePerm("mkeventd.seeall"), ] ) ) diff --git a/cmk/gui/openapi/endpoints/host_config/__init__.py b/cmk/gui/openapi/endpoints/host_config/__init__.py index 8ae0ac694b2..1a682565b51 100644 --- a/cmk/gui/openapi/endpoints/host_config/__init__.py +++ b/cmk/gui/openapi/endpoints/host_config/__init__.py @@ -122,9 +122,9 @@ permissions.Undocumented( permissions.AnyPerm( [ - permissions.Perm("bi.see_all"), + permissions.OkayToIgnorePerm("bi.see_all"), permissions.Perm("general.see_all"), - permissions.Perm("mkeventd.seeall"), + permissions.OkayToIgnorePerm("mkeventd.seeall"), ] ) ), @@ -139,9 +139,9 @@ permissions.Undocumented( permissions.AnyPerm( [ - permissions.Perm("bi.see_all"), + permissions.OkayToIgnorePerm("bi.see_all"), permissions.Perm("general.see_all"), - permissions.Perm("mkeventd.seeall"), + permissions.OkayToIgnorePerm("mkeventd.seeall"), ] ) ), @@ -156,9 +156,9 @@ permissions.Undocumented( permissions.AnyPerm( [ - permissions.Perm("bi.see_all"), + permissions.OkayToIgnorePerm("bi.see_all"), permissions.Perm("general.see_all"), - permissions.Perm("mkeventd.seeall"), + permissions.OkayToIgnorePerm("mkeventd.seeall"), # only used to check if user can see a host permissions.Perm("wato.see_all_folders"), ] @@ -177,9 +177,9 @@ def with_access_check_permission(perm: permissions.BasePerm) -> permissions.Base permissions.Undocumented( permissions.AnyPerm( [ - permissions.Perm("bi.see_all"), + permissions.OkayToIgnorePerm("bi.see_all"), permissions.Perm("general.see_all"), - permissions.Perm("mkeventd.seeall"), + permissions.OkayToIgnorePerm("mkeventd.seeall"), # is only used to check if a user can see a host permissions.Perm("wato.see_all_folders"), ], diff --git a/cmk/gui/openapi/endpoints/service/__init__.py b/cmk/gui/openapi/endpoints/service/__init__.py index 702b6743982..7b780640db0 100644 --- a/cmk/gui/openapi/endpoints/service/__init__.py +++ b/cmk/gui/openapi/endpoints/service/__init__.py @@ -41,8 +41,8 @@ permissions.AnyPerm( [ permissions.Perm("general.see_all"), - permissions.Perm("bi.see_all"), - permissions.Perm("mkeventd.seeall"), + permissions.OkayToIgnorePerm("bi.see_all"), + permissions.OkayToIgnorePerm("mkeventd.seeall"), permissions.Perm("wato.see_all_folders"), ] )