Module: check_mk
Branch: master
Commit: 002ae64e8271c6a281193b5801010a798fa7bde7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=002ae64e8271c6…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 9 11:59:19 2018 +0100
Fixed issue in class hierarchy
Change-Id: Idc21526f8bc59ce8d8872f6267f0dc505285abf5
---
web/htdocs/pagetypes.py | 38 +++++++++++++++++++++-----------------
1 file changed, 21 insertions(+), 17 deletions(-)
diff --git a/web/htdocs/pagetypes.py b/web/htdocs/pagetypes.py
index 32f77a9..fd0b7a0 100644
--- a/web/htdocs/pagetypes.py
+++ b/web/htdocs/pagetypes.py
@@ -178,6 +178,10 @@ class Base(object):
return False
+ def _can_be_linked(self):
+ return True
+
+
def render_title(self):
return _u(self.title())
@@ -396,23 +400,6 @@ class PageRenderer(Base):
return self.title()
- def _can_be_linked(self):
- """Whether or not the thing can be linked to"""
- if self.is_hidden():
- return False # don't link to hidden things
-
- if self.is_mine():
- return True
-
- # Is this the visual which would be shown to the user in case the user
- # requests a visual with the current name?
- page = self.find_page(self.name())
- if page.owner() != self.owner():
- return False
-
- return self.is_public()
-
-
#.
# .--Overridable---------------------------------------------------------.
@@ -494,6 +481,23 @@ class Overridable(Base):
return self.is_mine() and config.user.may("general.edit_" +
self.type_name())
+ def _can_be_linked(self):
+ """Whether or not the thing can be linked to"""
+ if self.is_hidden():
+ return False # don't link to hidden things
+
+ if self.is_mine():
+ return True
+
+ # Is this the visual which would be shown to the user in case the user
+ # requests a visual with the current name?
+ page = self.find_page(self.name())
+ if page.owner() != self.owner():
+ return False
+
+ return self.is_public()
+
+
@classmethod
def _delete_permission(cls):
return "general.edit_" + cls.type_name()