Multiverse / Multiverse-Core

The original Bukkit Multi-World Plugin!
BSD 3-Clause "New" or "Revised" License
949 stars 299 forks source link

Permission Nodes not working? #431

Closed 22alec22 closed 12 years ago

22alec22 commented 12 years ago

Hey so i love the plugin, but it appears as if the permission nodes are not working for me. I do not want to allow everyone to enter the creative portal, but at the moment i have to because i need to set it to ignore permissions in the config file. I am having the same problem with globalshop. I'm not entirely sure if it is this plugin specifically. I will post a copy of my permission file here: (If you see any issues that may be causing it please point them out)

groups:
    guest:
        default: false
        info:
            build: true
        permissions: []
    member:
        default: true
        info:
            build: true
            prefix: '[&2Member&f] '
        permissions:
        - essentials.who
        - essentials.help
        - essentials.home
        - essentials.motd
        - essentials.rules
        - essentials.sethome
        - essentials.spawn
        - essentials.msg
        - essentials.list
        - multiverse.access.world
        - multiverse.access.world_nether
        - multiverse.access.world_the_end
        - multiverse.access.creative
        - multiverse.access.survival
        - multiverse.portal.access.spawn
        - multiverse.portal.access.spawn2
        - multiverse.portal.access.creative
        - multiverse.portal.access.survival
        - globalshop.trade.*
        inheritance:
        - guest
    VIP:
        default: false
        info:
            build: true
            prefix: '[&2VIP&f] '
        permissions:
        - essentials.warp
        - essentials.setwarp
        - essentials.kit
        - essentials.kit.vip
        - essentials.kit.tools
        inheritance:
        - member
    mod:
        default: false
        info:
            build: true
            prefix: '[&5Mod&f] '
        permissions:
        - essentials.tp
        - essentials.tphere
        - essentials.god
        - essentials.kick
        - essentials.mute
        - essentials.tppos
        - essentials.jump
        - essentials.delhome
        - essentials.delwarp
        - essentials.unbanip
        - essentials.unban
        - essentials.tempban
        - essentials.sudo
        - essentials.socialspy
        - essentials.kill
        - essentials.invsee
        - essentials.clearinventory
        - essentials.banip
        - essentials.ban
        - essentials.whois
        - essentials.seen
        - essentials.realname
        - essentials.warp
        - essentials.setwarp
        - essentials.list
        inheritance:
        - member
    admin:
        default: false
        info:
            build: true
            prefix: '[&4Admin&f] '
        permissions:
        - '*'
        - simpleprefix.admin
        inheritance:
        - mod
    owner:
        default: false
        info:
            build: true
            prefix: '[&6Owner&f] '
        permissions: []
        inheritance:
        - admin

It is normally more spaced out, but the text box on here appears to flatten it all out.

fernferret commented 12 years ago

I am having the same problem with globalshop

This tells me something is not configured with your permissions plugin properly. I'm tagging this as unrelated to MV, but in order to help you you'll have to post a full startup log.

Thanks.

A51Rene commented 12 years ago

I'm having the same problem, with PEX. Only when giving multiverse.access.* to the group, they are able to tp to the worlds. I can't restrict access for a certain group to a certain world, a node like -multiverse.access.world_Nether does nog work.

Permissons.yml: http://pastie.org/3269021

After some changes, still not working: http://pastie.org/3269504

22alec22 commented 12 years ago

It is not my permissions in general, i have globalshop working now, but multiverse still refuses to work

fernferret commented 12 years ago

@22alec22 I should ask this. What permissions plugin are you using.

Also read up on this page: https://github.com/Multiverse/Multiverse-Core/wiki/Permissions

blakethepatton commented 12 years ago

Just came here and noticed that other people are having the same problem that I am having. I am running PEX permissions, and the permission nodes that I am adding are multiverse.core.spawn.self and world access. For the time being since I cannot get MV to hook into PEX permissions, I have the enforceaccess set to false.

joshuajaharwood commented 12 years ago

Yeah, same problem, need a fix soon please :(

blakethepatton commented 12 years ago

Same, I'm also glad I'm not the only one having this problem.

fernferret commented 12 years ago

Will look into this weekend hardcore (meaning download PEX and play with it). I've not had any problems with PermBukkit (what I test with).

A51Rene commented 12 years ago

Well, I also had problems with the nodes but it is all fixable, MV is not at fault. I received help on the PEX forum thread and got it all working. Teleporting with /mv tp is working and can be restricted for certain groups, however, portals are still not working (both Nether and End).

This is my latest Permissions.yml: http://pastie.org/3300934

What you will need to look at:

The change is very small that MV is not working, have a second look at your permission nodes.

Good luck, I hope it helped!

blakethepatton commented 12 years ago

I would paste my permissions, but I run around 40 different plugins and store my permissions in sql. The only permissions I am giving my players for multiverse are: "multiverse.core.spawn.self" and "multiverse.access.*" I did attempt to run it with enforceaccess with true and I could not get it to link into permissions that way either. Again, I am not using permissions that restrict access to specific worlds, I am only giving permissions to the players and they cannot use the commands are are returned with the permission nodes they need.

fernferret commented 12 years ago
  • using upper cases in a node like multiverse.access.world_Creative will not work, only lower cases in world names will work.

I have a feeling this is caused by the Permissions API, not Multiverse, and partially caused by pex (allowing mixed case perm checks): https://github.com/Bukkit/Bukkit/blob/master/src/main/java/org/bukkit/permissions/PermissibleBase.java#L154

EDIT: Actually, this could also be caused by us, allowing mixed case as well. I know I made portals lowercase, and this may be why, will have to check on worlds.

-multiverse.access.world_nether, it will ignore the negative node because it already has ''. -The same aplies with the -mv.bypass.gamemode. node and the general wildcard '' node. First -mv.bypass.gamemode. and on the next line the wildcard for an admin group. The other way around will not work.

Yes. I actually just realized this 'bug' last night. The trouble seems atm I don't know if I can ask the Perms API the difference between someone having a node to false and not having one at all. Right now the call is just: player.hasPermission("my.perm"). This doesn't work because it will return false for either not defined or defined as false. This is going to be the biggest challenge.

EDIT2: What would be awesome is: player.hasPermissionDefined("my.perm") if someone knows that this exists, please let me know.

blakethepatton commented 12 years ago

I am certain that PEX allows mixed case permissions. I know that the plugins EcoCreatures and the plugin ChestShop require mixed case permission nodes. Both are running fine. You might check out the code in those plugins and see if they have a different permission lookup command.

22alec22 commented 12 years ago

Sorry for my late reply, I was away for a while. When i originally posted this is was using Permissions 3. But I switched to PEX and it works completely fine.

main-- commented 12 years ago

@FernFerret I don't think that the permissions-API should tell you if a permission is set to false or only not set. The star-perm should just be overwritten by specific permissions.

fernferret commented 12 years ago

@main-- Yea, but apparently PEX is doing silly things to auto-recreate the * perm (overriding the API). Again, this is speculation ATM, but I'll test shortly and find out. If this is the case, the PEX authors and I will have a chat.

joshuajaharwood commented 12 years ago

Could this be related to the problem? I know PEX is running fine. Running PEX 1.18.

    2012-02-02 22:29:15 [SEVERE] java.lang.RuntimeException: Permissions manager is not accessable. Is the PermissionsEx plugin enabled?
    2012-02-02 22:29:15 [SEVERE]    at ru.tehkode.permissions.bukkit.PermissionsEx.getPermissionManager(PermissionsEx.java:152)
    2012-02-02 22:29:15 [SEVERE]    at ru.tehkode.permissions.bukkit.PermissionsEx.getUser(PermissionsEx.java:159)
    2012-02-02 22:29:15 [SEVERE]    at ru.tehkode.permissions.bukkit.superperms.PermissiblePEX.performCheck(PermissiblePEX.java:131)
    2012-02-02 22:29:15 [SEVERE]    at ru.tehkode.permissions.bukkit.superperms.PermissiblePEX.hasPermission(PermissiblePEX.java:123)
    2012-02-02 22:29:15 [SEVERE]    at org.bukkit.craftbukkit.entity.CraftHumanEntity.hasPermission(CraftHumanEntity.java:66)
    2012-02-02 22:29:15 [SEVERE]    at com.onarandombox.MultiverseCore.utils.MVPermissions.canIgnoreGameModeRestriction(MVPermissions.java:46)
    2012-02-02 22:29:15 [SEVERE]    at com.onarandombox.MultiverseCore.utils.PermissionTools.playerCanIgnoreGameModeRestriction(PermissionTools.java:242)
    2012-02-02 22:29:15 [SEVERE]    at com.onarandombox.MultiverseCore.listeners.MVPlayerListener.handleGameMode(MVPlayerListener.java:247)
    2012-02-02 22:29:15 [SEVERE]    at com.onarandombox.MultiverseCore.MVWorld.setActualGameMode(MVWorld.java:897)
    2012-02-02 22:29:15 [SEVERE]    at com.onarandombox.MultiverseCore.MVWorld.<init>(MVWorld.java:213)
    2012-02-02 22:29:15 [SEVERE]    at com.onarandombox.MultiverseCore.utils.WorldManager.addWorld(WorldManager.java:139)
    2012-02-02 22:29:15 [SEVERE]    at com.onarandombox.MultiverseCore.utils.WorldManager.addWorld(WorldManager.java:84)
    2012-02-02 22:29:15 [SEVERE]    at com.onarandombox.MultiverseCore.utils.WorldManager.loadWorlds(WorldManager.java:551)
    2012-02-02 22:29:15 [SEVERE]    at com.onarandombox.MultiverseCore.MultiverseCore.onEnable(MultiverseCore.java:249)
    2012-02-02 22:29:15 [SEVERE]    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:231)
    2012-02-02 22:29:15 [SEVERE]    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:1057)
    2012-02-02 22:29:15 [SEVERE]    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:379)
    2012-02-02 22:29:15 [SEVERE]    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:191)
    2012-02-02 22:29:15 [SEVERE]    at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:174)
    2012-02-02 22:29:15 [SEVERE]    at org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:444)
    2012-02-02 22:29:15 [SEVERE]    at org.bukkit.Bukkit.reload(Bukkit.java:188)
    2012-02-02 22:29:15 [SEVERE]    at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:22)
    2012-02-02 22:29:15 [SEVERE]    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:168)
    2012-02-02 22:29:15 [SEVERE]    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:386)
    2012-02-02 22:29:15 [SEVERE]    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:382)
    2012-02-02 22:29:15 [SEVERE]    at net.minecraft.server.MinecraftServer.b(MinecraftServer.java:573)
    2012-02-02 22:29:15 [SEVERE]    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:550)
    2012-02-02 22:29:15 [SEVERE]    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:434)
    2012-02-02 22:29:15 [SEVERE]    at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)

If not, I'll create a seperate issue.

blakethepatton commented 12 years ago

I'm not having any issues in my console. That looks like a separate issue.

joshuajaharwood commented 12 years ago

You sure? I only get this when reloading/turning server off/on, and it's to do with Multiverse and PEX, and I see something in there about permissions...

fernferret commented 12 years ago

@MatrixJ21 Your error appears to be caused by PEX failing to startup. Please make a new issue with the required info. . Thanks.

fernferret commented 12 years ago

@MatrixJ21 @bdot02

Here's a transcript I just did in PermBukkit (gonna do the PEX one next). I figured since I test with PermBukkit, it'd be good to have a control test:

It should be noted that even though this states it's MV builds are UNKNOWN they are actually:

00:20:23 [INFO] fernferret [/127.0.0.1:52015] logged in with entity id 477 at ([world] 12.75, 68.0, 237.0)
00:20:30 [INFO] [world]<fernferret> I don't have the list perm
>perm player setperm fernferret multiverse.core.list.worlds
00:20:47 [INFO] Player fernferret now has multiverse.core.list.worlds = true.
00:20:59 [INFO] [world]<fernferret> hmm is enforce access off?
>mv conf show         
00:21:14 [INFO]  === [ All Values ] ===
00:21:14 [INFO] enforceAccess = false, prefixChat = true, , teleportIntercept = true, firstSpawnOverride = true, firstSpawnWorld = world, displayPermErrors = true, globalDebug = 0, messageCooldown = 5000, version = 2.8
00:21:17 [INFO] [world]<fernferret> ah yes
00:21:19 [INFO] [world]<fernferret> it is.
00:21:21 [INFO] [world]<fernferret> i'll turn it on
>mv conf enforceaccess true
00:21:27 [INFO] SUCCESS! Values were updated successfully!
>mv conf show              
00:21:29 [INFO]  === [ All Values ] ===
00:21:29 [INFO] enforceAccess = true, prefixChat = true, , teleportIntercept = true, firstSpawnOverride = true, firstSpawnWorld = world, displayPermErrors = true, globalDebug = 0, messageCooldown = 5000, version = 2.8
00:21:35 [INFO] [world]<fernferret> cool
00:21:38 [INFO] [world]<fernferret> it says there are 0 worlds
00:21:50 [INFO] [world]<fernferret> let's grant myself the * perm to see them all
>perm player setperm fernferret multiverse.access.* true   
00:22:01 [INFO] Player fernferret now has multiverse.access.* = true.
00:22:14 [INFO] [world]<fernferret> I can see them all
>perm player setperm fernferret multiverse.access.skyworld2 false
00:22:26 [INFO] Player fernferret now has multiverse.access.skyworld2 = false.
00:22:33 [INFO] [world]<fernferret> sweet
00:22:40 [INFO] [world]<fernferret> now I see all but skyworld2
>say for the record, here's my version info
00:23:25 [INFO] [Server] for the record, here's my version info
>mv version
00:26:35 [INFO] [Multiverse-Core] [Multiverse-Core] Multiverse-Core Version: 2.3-bUNKNOWN
00:26:35 [INFO] [Multiverse-Core] [Multiverse-Core] Bukkit Version: git-Bukkit-1.1-R2-b1840jnks (MC: 1.1)
00:26:35 [INFO] [Multiverse-Core] [Multiverse-Core] Loaded Worlds: 8
00:26:35 [INFO] [Multiverse-Core] [Multiverse-Core] Multiverse Plugins Loaded: 3
00:26:35 [INFO] [Multiverse-Core] [Multiverse-Core] Economy being used: EconXP
00:26:35 [INFO] [Multiverse-Core] [Multiverse-Core] Permissions Plugin: Bukkit Permissions (SuperPerms)
00:26:35 [INFO] [Multiverse-Core] [Multiverse-Core] Dumping Config Values: (version -1.0)
00:26:35 [INFO] [Multiverse-Core] [Multiverse-Core]  messagecooldown: 5000
00:26:35 [INFO] [Multiverse-Core] [Multiverse-Core]  teleportcooldown: Not yet IMPLEMENTED
00:26:35 [INFO] [Multiverse-Core] [Multiverse-Core]  worldnameprefix: true
00:26:35 [INFO] [Multiverse-Core] [Multiverse-Core]  enforceaccess: true
00:26:35 [INFO] [Multiverse-Core] [Multiverse-Core]  displaypermerrors: true
00:26:35 [INFO] [Multiverse-Core] [Multiverse-Core]  teleportintercept: true
00:26:35 [INFO] [Multiverse-Core] [Multiverse-Core]  firstspawnoverride: true
00:26:35 [INFO] [Multiverse-Core] [Multiverse-Core]  firstspawnworld: NOT SET
00:26:35 [INFO] [Multiverse-Core] [Multiverse-Core]  debug: 0
00:26:35 [INFO] [Multiverse-Core] [Multiverse-Core] Special Code: FRN002
00:26:35 [INFO] [Multiverse-Core] [Multiverse-Adventure] Multiverse-Adventure Version: 2.3-bUNKNOWN
00:26:35 [INFO] [Multiverse-Core] [Multiverse-Adventure] Loaded AdventureWorlds: 1Multiverse-Adventure] Dumping loaded AdventureWorlds:[Multiverse-Adventure] MVAdventureWorld@bf313f4 [world=MVWorld@61013581 (Name: 'silverfish'), template=NAME.template, activationdelay=10, resetdelay=10][Multiverse-SignPortals] Multiverse-SignPortals Version: 2.3-bUNKNOWN
00:26:35 [INFO] [Multiverse-Core] [Multiverse-NetherPortals] Multiverse-NetherPortals Version: 2.3-bUNKNOWN
00:26:35 [INFO] [Multiverse-Core] [Multiverse-NetherPortals] World links: {}
00:26:35 [INFO] [Multiverse-Core] [Multiverse-NetherPortals] Nether Prefix: 
00:26:35 [INFO] [Multiverse-Core] [Multiverse-NetherPortals] Nether Suffix: _nether
00:26:35 [INFO] [Multiverse-Core] [Multiverse-NetherPortals] Special Code: FRN001

Also @22alec22 thanks for the response, but it seems that this issue has already become about something else :) I'll close it when the other 2 guys are happy!

fernferret commented 12 years ago

... And then stuff got really weird....

Here's the pex one. Very strange things happening... It looks like it's issuing commands somehow... I do not like this one bit.

http://pastie.org/3314039

fernferret commented 12 years ago

Ok. After realizing that I'm way too tired to be troubleshooting, here's what I've come up with:

Working Config

Ok. Order matters. I knew this to start with, but I'd never formally tested how to do the orders. The following config lets me have access to all the worlds except skyworld2. This ordering makes no sense to me, but this is how PEX works.

groups:
    default:
        default: true
        permissions:
        - modifyworld.*
users:
    fernferret:
        permissions:
        - -multiverse.access.skyworld2
        - multiverse.access.*
        - multiverse.core.list.worlds

Broken

Ok. Order matters, again. If you use this one. Users will be granted all worlds.

groups:
    default:
        default: true
        permissions:
        - modifyworld.*
users:
    fernferret:
        permissions:
        - multiverse.access.*
        - -multiverse.access.skyworld2
        - multiverse.core.list.worlds

@A51Rene - After making my discoveries, I re-read your post and realized I could have saved myself the exploration :( Thanks for the detailed bug report. As a side note, I did make a tiny change in the last few versions that I hope solves the rest of this issue.

I am now able to achieve expected results with PEX. Please let me know.

blakethepatton commented 12 years ago

So then the problem of adding permissions must be on my end. Seems as if you were able to permissions with pex.

fernferret commented 12 years ago

I'm going to close this issue, as I'm pretty convinced it's a configuration quirk, rather than a bug.

John000708 commented 11 years ago

PEX isn't supported anymore!