Merge pull request #1225 from okriuchykhin/ok_SCI_2534

Fix rendering permissions of inventory annotations [SCI-2534]
This commit is contained in:
Luka Murn 2018-07-13 15:18:59 +02:00 committed by GitHub
commit f67b8d05c7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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)