From bde236075cd6ef706efc370c725d9fc1d1f5bbba Mon Sep 17 00:00:00 2001 From: Taygunova Rina Date: Tue, 5 Dec 2023 16:08:45 +0300 Subject: [PATCH] ruby: remove historyClose and restore --- web/documentserver-example/ruby/app/models/users.rb | 2 ++ .../ruby/app/views/home/editor.html.erb | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/web/documentserver-example/ruby/app/models/users.rb b/web/documentserver-example/ruby/app/models/users.rb index e52dafdd..0f39d969 100644 --- a/web/documentserver-example/ruby/app/models/users.rb +++ b/web/documentserver-example/ruby/app/models/users.rb @@ -70,6 +70,8 @@ class Users "Can create new files from the editor", "Can see the information about Group2 users", "Can't submit forms", + "Can't close history", + "Can't restore the file version", ]; @@descr_user_0 = [ diff --git a/web/documentserver-example/ruby/app/views/home/editor.html.erb b/web/documentserver-example/ruby/app/views/home/editor.html.erb index 43a9bc4a..f64a3623 100755 --- a/web/documentserver-example/ruby/app/views/home/editor.html.erb +++ b/web/documentserver-example/ruby/app/views/home/editor.html.erb @@ -261,6 +261,11 @@ <% usersMentions = @file.get_users_mentions %> + if (config.editorConfig.user.id == "uid-3"){ + config.events["onRequestHistoryClose"] = null; + config.events["onRequestRestore"] = null; + }; + if (config.editorConfig.user.id) { // add mentions for not anonymous users config.events['onRequestUsers'] = function (event) {