@@ -37,7 +37,11 @@ $(function () {
3737 } ;
3838
3939 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+ )
4145 return $ . Deferred ( ) . reject ( ) ;
4246 return OctoPrint . plugins . file_check . get ( ) . done ( self . fromResponse ) ;
4347 } ;
@@ -58,7 +62,11 @@ $(function () {
5862 } ;
5963
6064 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+ )
6270 return ;
6371
6472 showConfirmationDialog ( {
@@ -90,12 +98,18 @@ $(function () {
9098 return (
9199 self . checkResult ( ) &&
92100 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+ )
94104 ) ;
95105 } ;
96106
97107 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+ )
99113 return ;
100114
101115 if ( _ . isPlainObject ( storage ) ) {
@@ -150,7 +164,11 @@ $(function () {
150164 self . onDataUpdaterPluginMessage = function ( plugin , data ) {
151165 if ( plugin !== "file_check" ) return ;
152166
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+ )
154172 return ;
155173
156174 switch ( data [ "action" ] ) {
@@ -231,7 +249,7 @@ $(function () {
231249 class : "filecheck-trigger accordion-heading-button btn-group" ,
232250 attr : {
233251 "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 )"
235253 }
236254 } ) . append (
237255 $ ( "<a/>" , {
@@ -256,7 +274,7 @@ $(function () {
256274
257275 const regex = / < d i v c l a s s = " u p l o a d e d " > / ;
258276 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>" +
260278 "<a href='javascript:void(0)' class='text-error' style='text-decoration: underline' data-bind='click: function() { $root.fileCheckViewModel.showCheckResult($data) }'>" +
261279 "<i class='fas fa-exclamation-circle'></i> " +
262280 gettext ( "File Check detected issues with this file!" ) +
@@ -272,7 +290,7 @@ $(function () {
272290 $ ( "<small/>" , {
273291 attr : {
274292 "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 )"
276294 }
277295 } )
278296 . append (
0 commit comments