Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Having Issues with Admin Permissions with FE. #525

Open
KaneHart opened this issue Jan 29, 2020 · 3 comments
Open

Having Issues with Admin Permissions with FE. #525

KaneHart opened this issue Jan 29, 2020 · 3 comments

Comments

@KaneHart
Copy link

Hello again using the latest version of Permissions things been going well besides a few odd errors like when your not in a town and use /mytown select and get the following error:
https://pastebin.com/4wa7gqyg

That is annoying but really it's fine as we can just tell people they get errors it normally means the command was done wrong or their not in a town, etc.

The biggest issue today we hit was starting to secure Admin land used for adventure style area's. Pretty much Teleport hubs, etc. The problem here is I get permissions error even if I gutt my permissions out 100% and just add like . or mytown.* etc. or add every node possible using p debug I still end up getting permission errors even with full out OP.

I'm guessing there might be something separate from the changes that you made that might of not applied to admin towns?

Either way Just throwing a report in if you don't have time for it I 100% understand. We can use an alt account or something and use normal player town protection.

Thanks!

@KaneHart
Copy link
Author

Opps example of the command:
/townadmin new Spawn
You have no permissions to use this command in game and with perm debug with FE on:
[00:46:53] [Server thread/INFO]: mytown.adm.cmd = true
[00:46:53] [Server thread/INFO]: zone SERVER group OPS for user Kane_Hart
[00:46:53] [Server thread/INFO]: mytown.adm.cmd.new = true
[00:46:53] [Server thread/INFO]: zone SERVER group OPS for user Kane_Hart

Thanks.

@bit2shift
Copy link

I'm pretty sure you'd have this same problem with either Bukkit or ServerTools, since the issue is either in MyTown or in MyPermissions.
The command fails because customManager is null in this permission check for /townadmin commands.
https://github.com/MyEssentials/MyPermissions/blob/7de3a6d23fbc6122c93dc83759e7e1ffb7679509/src/main/java/mypermissions/command/core/entities/CommandTree.java#L89

    public boolean hasPermission(ICommandSender sender, CommandTreeNode node) throws CommandException {
        if(!node.getAnnotation().console() && (sender instanceof MinecraftServer || sender instanceof RConConsoleSource || sender instanceof CommandBlockLogic)) {
            throw new CommandException("commands.generic.permission");
        }

        if(sender instanceof EntityPlayer) {
            UUID uuid = ((EntityPlayer) sender).getUniqueID();
            String permission = node.getAnnotation().permission();

            if (PermissionProxy.getPermissionManager().hasPermission(uuid, permission) &&
/* ---->>>> */ (customManager != null && customManager.hasPermission(uuid, permission))) {
                return true;
            }
            throw new CommandException("commands.generic.permission");
        }
        return true;
    }

@bit2shift
Copy link

Meanwhile, I've forked the MyPermissions repo and fixed this bug.
MyEssentials/MyPermissions@master...bit2shift:bugfix/custom-manager

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants