1
Fork 0
mirror of https://github.com/allthingslinux/tux.git synced 2024-10-02 16:43:12 +00:00
tux/docs/permissions.md

38 lines
1.5 KiB
Markdown
Raw Normal View History

feat(settings.json): add PERMISSION_LEVELS object to manage user permissions more effectively docs(PERMISSIONS.md): add new documentation file explaining the permissions management system refactor(schema.prisma): simplify GuildConfig model by removing unnecessary fields and adding permission level roles fields for better permissions management feat(config.py): add ConfigSelectMenu and ConfigSelectView classes for guild role configuration refactor(config.py): replace individual role setting commands with a single command using the new classes chore(config.py): comment out old role setting commands for reference, to be removed in future commits refactor: consolidate channel setting commands into a single command for better maintainability feat: add a new command to set all roles and channels using a select menu for improved user experience feat: add role configuration options for different permission levels This commit introduces the ability to configure roles for different permission levels (0-9) in the application. This allows for more granular control over user permissions and enhances the flexibility of the role management system. refactor(client.py): conditionally set log_queries based on DEBUG constant for better control over logging in different environments refactor(guild_config.py): simplify method and variable names for readability and maintainability style(guild_config.py): improve code formatting for better readability refactor(guild_config.py): simplify variable names by removing redundant 'guild_' prefix chore(guild_config.py): comment out unused methods to improve code readability and performance refactor(guild_config.py): simplify field names for better readability and consistency feat(guild_config.py): comment out unused role retrieval methods to improve performance chore(guild_config.py): add commented out code for future permission level roles feature fix(main.py): uncomment debug related imports and function calls to enable debugging feat(constants.py): change default value of DEBUG constant to True to enable debugging by default
2024-07-27 20:21:24 +00:00
# Permissions Management
Tux employs a level-based permissions system to control command execution.
Each command is associated with a specific permission level, ensuring that only users with the necessary clearance can execute it.
feat(settings.json): add PERMISSION_LEVELS object to manage user permissions more effectively docs(PERMISSIONS.md): add new documentation file explaining the permissions management system refactor(schema.prisma): simplify GuildConfig model by removing unnecessary fields and adding permission level roles fields for better permissions management feat(config.py): add ConfigSelectMenu and ConfigSelectView classes for guild role configuration refactor(config.py): replace individual role setting commands with a single command using the new classes chore(config.py): comment out old role setting commands for reference, to be removed in future commits refactor: consolidate channel setting commands into a single command for better maintainability feat: add a new command to set all roles and channels using a select menu for improved user experience feat: add role configuration options for different permission levels This commit introduces the ability to configure roles for different permission levels (0-9) in the application. This allows for more granular control over user permissions and enhances the flexibility of the role management system. refactor(client.py): conditionally set log_queries based on DEBUG constant for better control over logging in different environments refactor(guild_config.py): simplify method and variable names for readability and maintainability style(guild_config.py): improve code formatting for better readability refactor(guild_config.py): simplify variable names by removing redundant 'guild_' prefix chore(guild_config.py): comment out unused methods to improve code readability and performance refactor(guild_config.py): simplify field names for better readability and consistency feat(guild_config.py): comment out unused role retrieval methods to improve performance chore(guild_config.py): add commented out code for future permission level roles feature fix(main.py): uncomment debug related imports and function calls to enable debugging feat(constants.py): change default value of DEBUG constant to True to enable debugging by default
2024-07-27 20:21:24 +00:00
## Initial Setup
When setting up Tux for a new server, the server owner can assign one or multiple roles to each permission level. Users then inherit the highest permission level from their assigned roles.
For instance, if a user has one role with a permission level of 2 and another with a level of 3, their effective permission level will be 3.
feat(settings.json): add PERMISSION_LEVELS object to manage user permissions more effectively docs(PERMISSIONS.md): add new documentation file explaining the permissions management system refactor(schema.prisma): simplify GuildConfig model by removing unnecessary fields and adding permission level roles fields for better permissions management feat(config.py): add ConfigSelectMenu and ConfigSelectView classes for guild role configuration refactor(config.py): replace individual role setting commands with a single command using the new classes chore(config.py): comment out old role setting commands for reference, to be removed in future commits refactor: consolidate channel setting commands into a single command for better maintainability feat: add a new command to set all roles and channels using a select menu for improved user experience feat: add role configuration options for different permission levels This commit introduces the ability to configure roles for different permission levels (0-9) in the application. This allows for more granular control over user permissions and enhances the flexibility of the role management system. refactor(client.py): conditionally set log_queries based on DEBUG constant for better control over logging in different environments refactor(guild_config.py): simplify method and variable names for readability and maintainability style(guild_config.py): improve code formatting for better readability refactor(guild_config.py): simplify variable names by removing redundant 'guild_' prefix chore(guild_config.py): comment out unused methods to improve code readability and performance refactor(guild_config.py): simplify field names for better readability and consistency feat(guild_config.py): comment out unused role retrieval methods to improve performance chore(guild_config.py): add commented out code for future permission level roles feature fix(main.py): uncomment debug related imports and function calls to enable debugging feat(constants.py): change default value of DEBUG constant to True to enable debugging by default
2024-07-27 20:21:24 +00:00
## Advantages
The level-based system allows Tux to manage command execution efficiently across different servers.
It offers a more flexible solution than just relying on Discord's built-in permissions, avoiding the need to hardcode permissions into the bot.
This flexibility makes it easier to modify permissions without changing the bots underlying code, accommodating servers with custom role names seamlessly.
feat(settings.json): add PERMISSION_LEVELS object to manage user permissions more effectively docs(PERMISSIONS.md): add new documentation file explaining the permissions management system refactor(schema.prisma): simplify GuildConfig model by removing unnecessary fields and adding permission level roles fields for better permissions management feat(config.py): add ConfigSelectMenu and ConfigSelectView classes for guild role configuration refactor(config.py): replace individual role setting commands with a single command using the new classes chore(config.py): comment out old role setting commands for reference, to be removed in future commits refactor: consolidate channel setting commands into a single command for better maintainability feat: add a new command to set all roles and channels using a select menu for improved user experience feat: add role configuration options for different permission levels This commit introduces the ability to configure roles for different permission levels (0-9) in the application. This allows for more granular control over user permissions and enhances the flexibility of the role management system. refactor(client.py): conditionally set log_queries based on DEBUG constant for better control over logging in different environments refactor(guild_config.py): simplify method and variable names for readability and maintainability style(guild_config.py): improve code formatting for better readability refactor(guild_config.py): simplify variable names by removing redundant 'guild_' prefix chore(guild_config.py): comment out unused methods to improve code readability and performance refactor(guild_config.py): simplify field names for better readability and consistency feat(guild_config.py): comment out unused role retrieval methods to improve performance chore(guild_config.py): add commented out code for future permission level roles feature fix(main.py): uncomment debug related imports and function calls to enable debugging feat(constants.py): change default value of DEBUG constant to True to enable debugging by default
2024-07-27 20:21:24 +00:00
## Available Permission Levels
Below is the hierarchy of permission levels available in Tux:
- **0: Member**
feat(settings.json): add PERMISSION_LEVELS object to manage user permissions more effectively docs(PERMISSIONS.md): add new documentation file explaining the permissions management system refactor(schema.prisma): simplify GuildConfig model by removing unnecessary fields and adding permission level roles fields for better permissions management feat(config.py): add ConfigSelectMenu and ConfigSelectView classes for guild role configuration refactor(config.py): replace individual role setting commands with a single command using the new classes chore(config.py): comment out old role setting commands for reference, to be removed in future commits refactor: consolidate channel setting commands into a single command for better maintainability feat: add a new command to set all roles and channels using a select menu for improved user experience feat: add role configuration options for different permission levels This commit introduces the ability to configure roles for different permission levels (0-9) in the application. This allows for more granular control over user permissions and enhances the flexibility of the role management system. refactor(client.py): conditionally set log_queries based on DEBUG constant for better control over logging in different environments refactor(guild_config.py): simplify method and variable names for readability and maintainability style(guild_config.py): improve code formatting for better readability refactor(guild_config.py): simplify variable names by removing redundant 'guild_' prefix chore(guild_config.py): comment out unused methods to improve code readability and performance refactor(guild_config.py): simplify field names for better readability and consistency feat(guild_config.py): comment out unused role retrieval methods to improve performance chore(guild_config.py): add commented out code for future permission level roles feature fix(main.py): uncomment debug related imports and function calls to enable debugging feat(constants.py): change default value of DEBUG constant to True to enable debugging by default
2024-07-27 20:21:24 +00:00
- **1: Support**
- **2: Junior Moderator**
- **3: Moderator**
- **4: Senior Moderator**
- **5: Administrator**
- **6: Head Administrator**
- **7: Server Owner**
- **8: Sys Admin** (User ID list in `config.json`)
- **9: Bot Owner** (User ID in `config.json`)
feat(settings.json): add PERMISSION_LEVELS object to manage user permissions more effectively docs(PERMISSIONS.md): add new documentation file explaining the permissions management system refactor(schema.prisma): simplify GuildConfig model by removing unnecessary fields and adding permission level roles fields for better permissions management feat(config.py): add ConfigSelectMenu and ConfigSelectView classes for guild role configuration refactor(config.py): replace individual role setting commands with a single command using the new classes chore(config.py): comment out old role setting commands for reference, to be removed in future commits refactor: consolidate channel setting commands into a single command for better maintainability feat: add a new command to set all roles and channels using a select menu for improved user experience feat: add role configuration options for different permission levels This commit introduces the ability to configure roles for different permission levels (0-9) in the application. This allows for more granular control over user permissions and enhances the flexibility of the role management system. refactor(client.py): conditionally set log_queries based on DEBUG constant for better control over logging in different environments refactor(guild_config.py): simplify method and variable names for readability and maintainability style(guild_config.py): improve code formatting for better readability refactor(guild_config.py): simplify variable names by removing redundant 'guild_' prefix chore(guild_config.py): comment out unused methods to improve code readability and performance refactor(guild_config.py): simplify field names for better readability and consistency feat(guild_config.py): comment out unused role retrieval methods to improve performance chore(guild_config.py): add commented out code for future permission level roles feature fix(main.py): uncomment debug related imports and function calls to enable debugging feat(constants.py): change default value of DEBUG constant to True to enable debugging by default
2024-07-27 20:21:24 +00:00
By leveraging these permission levels, Tux provides a robust and adaptable way to manage who can execute specific commands,
making it suitable for various server environments.