mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-12-11 22:56:41 +08:00
Merge pull request #1225 from okriuchykhin/ok_SCI_2534
Fix rendering permissions of inventory annotations [SCI-2534]
This commit is contained in:
commit
f67b8d05c7
2 changed files with 4 additions and 2 deletions
|
|
@ -41,7 +41,8 @@ module SmartAnnotations
|
||||||
end
|
end
|
||||||
|
|
||||||
def repository_item(name, user, type, object)
|
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)
|
return SmartAnnotations::HtmlPreview.html(nil, type, object)
|
||||||
end
|
end
|
||||||
SmartAnnotations::HtmlPreview.html(name, type, object)
|
SmartAnnotations::HtmlPreview.html(name, type, object)
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,8 @@ module SmartAnnotations
|
||||||
end
|
end
|
||||||
|
|
||||||
def repository_item(name, user, type, object)
|
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)
|
return SmartAnnotations::TextPreview.text(nil, type, object)
|
||||||
end
|
end
|
||||||
SmartAnnotations::TextPreview.text(name, type, object)
|
SmartAnnotations::TextPreview.text(name, type, object)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue