@@ -37,7 +37,11 @@ $(function () {
37
37
} ;
38
38
39
39
self . requestData = function ( ) {
40
- if ( ! self . loginState . hasPermission ( self . access . permissions . FILES_DOWNLOAD ) )
40
+ if (
41
+ ! self . loginState . hasPermission (
42
+ self . access . permissions . PLUGIN_FILE_CHECK_RUN
43
+ )
44
+ )
41
45
return $ . Deferred ( ) . reject ( ) ;
42
46
return OctoPrint . plugins . file_check . get ( ) . done ( self . fromResponse ) ;
43
47
} ;
@@ -58,7 +62,11 @@ $(function () {
58
62
} ;
59
63
60
64
self . checkAll = function ( ) {
61
- if ( ! self . loginState . hasPermission ( self . access . permissions . FILES_DOWNLOAD ) )
65
+ if (
66
+ ! self . loginState . hasPermission (
67
+ self . access . permissions . PLUGIN_FILE_CHECK_RUN
68
+ )
69
+ )
62
70
return ;
63
71
64
72
showConfirmationDialog ( {
@@ -90,12 +98,18 @@ $(function () {
90
98
return (
91
99
self . checkResult ( ) &&
92
100
self . checkResult ( ) [ key ] &&
93
- self . loginState . hasPermission ( self . access . permissions . FILES_DOWNLOAD )
101
+ self . loginState . hasPermission (
102
+ self . access . permissions . PLUGIN_FILE_CHECK_RUN
103
+ )
94
104
) ;
95
105
} ;
96
106
97
107
self . showCheckResult = function ( storage , file ) {
98
- if ( ! self . loginState . hasPermission ( self . access . permissions . FILES_DOWNLOAD ) )
108
+ if (
109
+ ! self . loginState . hasPermission (
110
+ self . access . permissions . PLUGIN_FILE_CHECK_RUN
111
+ )
112
+ )
99
113
return ;
100
114
101
115
if ( _ . isPlainObject ( storage ) ) {
@@ -150,7 +164,11 @@ $(function () {
150
164
self . onDataUpdaterPluginMessage = function ( plugin , data ) {
151
165
if ( plugin !== "file_check" ) return ;
152
166
153
- if ( ! self . loginState . hasPermission ( self . access . permissions . FILES_DOWNLOAD ) )
167
+ if (
168
+ ! self . loginState . hasPermission (
169
+ self . access . permissions . PLUGIN_FILE_CHECK_RUN
170
+ )
171
+ )
154
172
return ;
155
173
156
174
switch ( data [ "action" ] ) {
@@ -231,7 +249,7 @@ $(function () {
231
249
class : "filecheck-trigger accordion-heading-button btn-group" ,
232
250
attr : {
233
251
"data-bind" :
234
- "visible: $root.fileCheckViewModel.fullCheckAvailable() && $root.loginState.hasPermission($root.access.permissions.FILES_DOWNLOAD )"
252
+ "visible: $root.fileCheckViewModel.fullCheckAvailable() && $root.loginState.hasPermission($root.access.permissions.PLUGIN_FILE_CHECK_RUN )"
235
253
}
236
254
} ) . append (
237
255
$ ( "<a/>" , {
@@ -256,7 +274,7 @@ $(function () {
256
274
257
275
const regex = / < d i v c l a s s = " u p l o a d e d " > / ;
258
276
const template =
259
- "<div class='filecheck_result' data-bind='visible: $root.fileCheckViewModel.hasCheckResult($data) && $root.loginState.hasPermission($root.access.permissions.FILES_DOWNLOAD )'><small>" +
277
+ "<div class='filecheck_result' data-bind='visible: $root.fileCheckViewModel.hasCheckResult($data) && $root.loginState.hasPermission($root.access.permissions.PLUGIN_FILE_CHECK_RUN )'><small>" +
260
278
"<a href='javascript:void(0)' class='text-error' style='text-decoration: underline' data-bind='click: function() { $root.fileCheckViewModel.showCheckResult($data) }'>" +
261
279
"<i class='fas fa-exclamation-circle'></i> " +
262
280
gettext ( "File Check detected issues with this file!" ) +
@@ -272,7 +290,7 @@ $(function () {
272
290
$ ( "<small/>" , {
273
291
attr : {
274
292
"data-bind" :
275
- "visible: $root.fileCheckViewModel.hasCheckResult($root.filepath()) && $root.loginState.hasPermission($root.access.permissions.FILES_DOWNLOAD )"
293
+ "visible: $root.fileCheckViewModel.hasCheckResult($root.filepath()) && $root.loginState.hasPermission($root.access.permissions.PLUGIN_FILE_CHECK_RUN )"
276
294
}
277
295
} )
278
296
. append (
0 commit comments