mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-20 23:16:15 +08:00
Fix rendering permissions of inventory annotations [SCI-2534]
This commit is contained in:
parent
10554fecb4
commit
6660b240c8
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue