[V3 Permissions] Rule precedence bug. #2313
Labels
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot#2313
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Applying a default to a Cog as well as to a command within a Cog (Default deny cog, allow command) does not allow the command.
With current intended precedence, this should allow the command.
Initially reported by <@203619925179236352> (Céli28), confirmed by me and <@218773382617890828> (TrustyJAID)
This appears to just be default rules not playing well. Defaults (for cogs) are not be overridden by other rules which apply in the current context, and additionally, defaults can lock owners out of commands. This might indicate an exception being raised and suppressed silently breaking the expected behavior here based on the intended flow, but I won't have a chance to take a closer look into this until later.
Looks related to #2249
Thanks for reporting, will look into this and #2249 when I get the chance.
I'm not sure it's related to 2249. 2249 being a UX issue that could possibly be caused by this leads me to think that solving this first and seeing if 2249 disappears with it is the best course of action for prioritizing fixes, then fixing that as a separate fix if this is not the case.
After a bunch of testing... Neither I, Toby, or Kowlin have been able to reproduce this anymore on V3/release/3.0.0. I'm closing this, but if anyone can still reproduce it on an up to date bot, please still comment.
Whoo boy, we have a reproduce now.
Thanks? Soulrfit <@142006827155062784>
yaml content collapsed in here.
Guild acl:
There is no global acl set.
Ah I misunderstood what the bug was when I last investigated this issue. I thought the bug was that default cog rules were taking precedence over actual model-based rules for commands. I now realise it's for default deny cog, default allow command.
This will also be the case for default deny supercommand, default allow subcommand.
I can see why this is occurring - the reason subcommand rules are able to take precedence over cog/supercommand rules is because when a rule is set, the parent's rules are modified too. This is not the case for default rules, and in fact they essentially follow the same process that was used before the permissions rewrite. However, I don't think it will be hard to incorporate them into the new technique.