Separation between user and "admin" Quota, Settings, etc. #268
Replies: 1 comment
-
Hey @LumiWasTaken 👋 You can add a simple condition to check if the User using /Settings is 'Moderator', or any role name to your convenience. Just edit the line : Line 244 in 4b3b62f To :
This will check if the discord user is member of the named role, and basic users won't be able to use the command in any channel. Regarding the Loras, it may be a more evolded edit regarding what you exactly want. Different approaches comes to my mind. The simple one is that you'll have to manually tag the Lora, from the bot or from the webui.
Or directly in the filename of the Loras. You can simply parse the Loras names from the bot to check with a few lines, like above, if the user is allowed to use them. A very simple solution, for me, is to edit : Lines 358 to 360 in 4b3b62f To something like :
Here, if one of the selected Loras start with 'private', it will check if the user has the 'Moderator' discord role. To actually hide Loras for these users, as you want, would also require to change the 'autocomplete' when loading the extranet list to something else using a whitelist/blacklist. So a refactored function in settings.py and the lists in the config file. This way, only the lists need to be maintained.
Cheers ! 🥂 |
Beta Was this translation helpful? Give feedback.
-
Hiya,
i'm setting up a server for me and my friends to mess around with.
TL;DR: I have Loras / embeddings that i'd like to be restricted, so for example only admins can view it because they might be still being tested or simply shouldn't be made available because people can't behave.
So my idea was to be able to tag Loras as restricted, making them hidden from the selection.
Additionally, preventing users to edit settings would be cool, i haven't found anything about this documented... so maybe i'm just silly.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions