frc5183 / Oatmeal

MIT License
2 stars 0 forks source link

fix(oatmeal): Fixes Admin/Owner issues by removing double-checking an… #33

Closed Trip-kun closed 8 months ago

Trip-kun commented 8 months ago

…d being more verbose to end user

Summary by CodeRabbit

coderabbitai[bot] commented 8 months ago

Walkthrough

The recent updates involve enhancing security and control within the Oatmeal application. Import statements for the Config class have been added to certain command files, and new conditional checks ensure that administrative privileges are not altered for users listed as owners. Additionally, the MariaUser entity has seen a refinement in its setAdmin and setOwner methods, with stricter parameter requirements and simplified assignment logic.

Changes

File Path Change Summary
.../oatmeal/commands/oatmeal/admin/SetAdmin.java Added Config import and conditional check to protect owner users.
.../oatmeal/commands/oatmeal/owner/SetOwner.java Added Config import and conditional check to prevent owner changes.
.../oatmeal/entities/mariadb/MariaUser.java Updated setAdmin method signature and simplified setOwner logic.

πŸ‡βœ¨ In the land of code, where the Oatmeal lies, A rabbit hopped in, with a twinkle in its eyes. "No more shall owners fear an admin's plight, For checks and balances now guard the night." πŸŒ™πŸ”’ πŸ‡βœ¨


Tips ### Chat with CodeRabbit Bot (`@coderabbitai`) - If you reply to a *review comment* from CodeRabbit, the bot will automatically respond. - To engage with CodeRabbit bot directly around the specific lines of code in the PR, mention @coderabbitai in your review comment - Note: Review comments are made on code diffs or files, not on the PR overview. - Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed. ### CodeRabbit Commands (invoked as PR comments) - `@coderabbitai pause` to pause the reviews on a PR. - `@coderabbitai resume` to resume the paused reviews. - `@coderabbitai review` to trigger a review. This is useful when automatic reviews are disabled for the repository. - `@coderabbitai resolve` resolve all the CodeRabbit review comments. - `@coderabbitai help` to get help. Note: For conversation with the bot, please use the review comments on code diffs or files. ### CodeRabbit Configration File (`.coderabbit.yaml`) - You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository. - The JSON schema for the configuration file is available [here](https://coderabbit.ai/integrations/coderabbit-overrides.v2.json). - If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/coderabbit-overrides.v2.json`