discord-api-docs icon indicating copy to clipboard operation
discord-api-docs copied to clipboard

Permissions v2 UI doesn't reflect `default_member_permissions`

Open SuperchupuDev opened this issue 2 years ago • 4 comments

Description

Commands with default_member_permissions show up in the command permissions menu as being enabled for @everyone, even though they are only enabled for certain permissions by default. Instead, they should show up correctly in the menu.

Steps to Reproduce

  1. Make a command with default_member_permissions
  2. Check the command at the integrations tab of the guild

Expected Behavior

It's shown up as disabled for @everyone and enabled for the roles that have the permissions you set up

Current Behavior

It's shown up as enabled for @everyone

Screenshots/Videos

JSON of the deployed command
{
    "name": "perms_v2",
    "description": "you need manage guilds ithink",
    "default_member_permissions": "32"
}
User that doesn't have MANAGE_GUILDS trying to use the command (works as expected, the guild has access to backend v2 too)

image

The UI fails to reflect that only users with MANAGE_GUILDS can use the command

image

Client and System Information

Canary 126462 (1f5f36e) Host 1.0.46 Windows 10 64-Bit (10.0.19044)

SuperchupuDev avatar May 01 '22 14:05 SuperchupuDev

Another thing to look out for: If the server's admin changes the base integration permissions (and everything remains synced), then all the specific default_member_permissions stop applying, same as if you unsync those commands.

This might be a bug, but only in relation to the present issue, as it is not clear when exactly users are able or unable to use restricted commands. This becomes a vulnerability risk for servers using a bot that depends on permissions v2.

hollowstrawberry avatar May 02 '22 02:05 hollowstrawberry

Yes. It's like combining per channel permissions + per role/member permissions + default permissions, makes the "bug" come alive.

TIBI4 avatar May 03 '22 05:05 TIBI4

I was just looking for this exact thing. A more general description I found is below. @Rapptz any idea if this will be supported? https://msciotti.notion.site/msciotti/Command-Permissions-V2-4d113cb49090409f998f3bd80a06c3bd

casper-hansen avatar Jul 09 '22 10:07 casper-hansen

I believe I'm having the same issue. setting default_member_permissions to 0 still shows up as enabled for everyone, but they can't use the commands (like intended). It's a bit annoying because now I can't allow everyone to use a command by overriding it in the UI.

zwamdurkel avatar Jul 21 '22 22:07 zwamdurkel

It has just been shipped, thanks a lot for adding it!

image image

SuperchupuDev avatar Aug 25 '22 17:08 SuperchupuDev