sd-webui-infinite-image-browsing icon indicating copy to clipboard operation
sd-webui-infinite-image-browsing copied to clipboard

控制模式提示的”不再显示“按钮导致的持续警告 Clicking access control mode tips "dontShowAgain" causes continually error warning

Open arqli opened this issue 6 months ago • 3 comments

In my workspace, I need access control due to sharing, so i use .env file to set read-only mode. but the first time load this extension, when it shows access control mode tips, after i click 'dontShowAgain', it continually pops error warning User is not authorized to perform this action. Required permission: read-write, write-only in every operating steps. I have found the problem is cause by the access control mode itself. When clicking 'dontShowAgain', it calls app_fe_setting in API, which need WRITEABLE_PERMISSIONS. Thus "global.dontShowAgain = true" will NOT be applied.

MAYBE this call repeatly trying in background??? which causes continually error warning.

I didn`t research on it further. To solve this problem, I temporarily deleted some local codes in JS file compiled by vue, which corresponds to VUE code in file \vue\src\page\SplitViewTab\emptyStartup.vue line 176-189, to avoid other users click it. By this dealing, other function in this extension runs without abnormalities so far.

To permanently solve this problem, i have 2 ideas as follow:

  1. "global.dontShowAgain = true": put this variable in local cookie (better for multi-user), rather than background database;
  2. add a condition statement in API app_fe_setting, if operation is dontShowAgain, it can be NOT DEPENDS write_permission_required

errors

我使用中因为需要共享出去,所以需要访问控制,在 .env 文件中设置了只读模式。 但首次加载此插件,会显示访问控制模式的提示,点击“不再显示”之后会在每一步操作中持续弹出错误警告: User is not authorized to perform this action. Required permission: read-write, write-only 我已经找到此问题是由于访问控制模式本身造成的,点击“不再显示”时,它调用了 API 中的app_fe_setting,这需要写入权限。因此,“global.dontShowAgain = true”语句失效。或许是这个调用在后台的重复尝试导致了持续弹出的错误警告?

我没有进一步研究这个问题。为了解决这个问题,我暂时删除了VUE编译后的 JS 文件中的一些本地代码,这部分代码对应于 VUE 代码文件 \vue\src\page\SplitViewTab\emptyStartup.vue 的第 176-189 行,避免共享的其他用户点击。这样处理后插件中的其他功能目前运行没有异常。

为了永久解决这个问题,我有两个想法如下:

  1. “global.dontShowAgain = true”:将这个变量存放在本地 Cookie 中(更适合多用户的情况),而不是存储在后台数据库中;
  2. 在 API app_fe_setting 中添加一个条件语句,如果操作是“dontShowAgain”,则不需要验证 write_permission_required

arqli avatar Aug 13 '24 04:08 arqli