Fix rendering permissions of inventory annotations [SCI-2534]

This commit is contained in:
Oleksii Kriuchykhin 2018-06-28 15:30:32 +02:00
parent 10554fecb4
commit 6660b240c8
2 changed files with 4 additions and 2 deletions

View file

@ -41,7 +41,8 @@ module SmartAnnotations
end
def repository_item(name, user, type, object)
if object && SmartAnnotations::PermissionEval.check(user, type, object)
if object
return unless SmartAnnotations::PermissionEval.check(user, type, object)
return SmartAnnotations::HtmlPreview.html(nil, type, object)
end
SmartAnnotations::HtmlPreview.html(name, type, object)

View file

@ -53,7 +53,8 @@ module SmartAnnotations
end
def repository_item(name, user, type, object)
if object && SmartAnnotations::PermissionEval.check(user, type, object)
if object
return unless SmartAnnotations::PermissionEval.check(user, type, object)
return SmartAnnotations::TextPreview.text(nil, type, object)
end
SmartAnnotations::TextPreview.text(name, type, object)