DiscordSRV

DiscordSRV

86.8k Downloads

Don't check OP status with rank sync hasPermission

david50407 opened this issue ยท 7 comments

commented

Request for PermissionEx (and any other permission manager plugins) support directly.

When using Minecraft permission to Discord role syncing, if the player is Op, the bukkit hasPermission always returns true, and this causes any Op player get all Discord role which as listed in the sync id list.

By calling PermissionEx api directly can prevent this problem and this is useful to building teaming in Discord, our server use the permission -> role syncing for building a MMORPG-like chat system.
With this issue, the Op player will be assigned into all teams, but we want that each player can only join a team even if the player is Op/Admin.

commented

Use permission negation.
Or don't have ops and just give them permissions.

commented

The hasPermission will first check if the player has op and return true, so negation is not worked.

And if the moderator doesn't has op flag, he/she cannot use some vanilla functions like editing command blocks.

commented

First off I'm pretty sure that negating works even for ops, from what I've learnt while developing but ofcourse I might be wrong.
The I come to the point that why would a moderator need to edit a command block? I think that's a bit overpowered and no moderator should have to do it in the first place but ofcourse every server has their own ideas etc.. So that's not up to me to say.
Then there are permission nodes for vanilla commands and other vanilla features.
Just look them up and even if you can't find it there is probably a plugin for it out there. Though you probably don't have to use a plugin because there are nodes for them.

commented

Moderators shouldn't have op lol

I'll make it so op status isn't checked for role sync

commented

Wait.... I'm confused now.
I checked the Bukkit code and it didn't pass op as true in hasPermission.
PEX has a config that can set Op as always true but I disabled this feature.

Here's how I reproduced this:

  1. I create a group named MOD on PEX and add a test player into it. (also give him Op flag)
  2. Then give MOD the permission node -discordsrv.sync.ROLE_ID (real role id), and give default -discordsrv.sync.*.
  3. When I use PEX's command to check if that guy has discordsrv.sync.ROLE_ID permission, it throws false to me.
    (And also false on any other player.)
  4. Wait for sync, and the test player get the role with the test role.
commented
commented

wow nice work