webbukkit / dynmap

A set of Minecraft mods that provide a real time web-based map system for various Minecraft server implementations.
https://www.reddit.com/r/Dynmap/
Apache License 2.0
2.05k stars 417 forks source link

Permissions for protected map not working (bPermissions) #1009

Closed megge closed 5 years ago

megge commented 11 years ago

Hi there,

I have a little problem concerning protected maps. Users (including me) have the permission node

but we can't see the map on the dynmap. The other maps work, though. You can take a look at it here

Part of the worldconfig

worlds:
  - name: towny
    title: "Towny"
    enabled: true
    hidestyle: air
    sendposition: true
    maps:
      - class: org.dynmap.hdmap.HDMap
        name: sd
        title: "SD Map"
        icon: images/block_flat.png
        perspective: default-sd
        shader: texturepack
        lighting: shadows-smooth
        image-format: jpg-q75
        protected: false
      - class: org.dynmap.hdmap.HDMap
        name: hd
        title: "HD Map"
        icon: images/block_flat.png
        perspective: default-hd
        shader: texturepack
        lighting: dn-bs
        image-format: jpg-q100
        protected: true
      - class: org.dynmap.hdmap.HDMap
        name: topo
        title: "Topological"
        icon: images/block_flat.png
        perspective: default-topo
        shader: topo-noplants
        lighting: default
        image-format: jpg-q75
        protected: false

configuration.txt Versions:

Can't think of any other related plugin, here is my full plugin list: bPermissions, Massband, FarmControl, Minequery, Craftconomy3, WorldEdit, NoCheatPlus, Buycraft, CommandBook, Vault, Multiverse-Core, CombatTag, Questioner, WorldGuard, BloodMoon, bChatManager, dynmap, HeroicDeathPlus, Dynmap-WorldGuard, MineBackup, CommandHelper, Turnstile, Gods, BKCommonLib, mcbans, VariableTriggers, ProtocolLib, Bankcraft, CleanroomGenerator, Jobs, WorldBorder, SWatchdog, MultiPack, Towny, Courier, Multiverse-Portals, Multiverse-Inventories, TagAPI, VanishNoPacket, Multiverse-NetherPortals, HomeSpawnPlus, NoLagg, ChestShop, Dynmap-Towny

I guess there is an issue with the permissions being cached (I had a similar problem with a protected world, which just worked after a while), but I can't access all of the source code :/

mikeprimm commented 11 years ago

Key things with bPermissions - we check for the permissions on the "default world", versus the specific world that the player happens to be on (which would not be useful while they're offline). I believe this corresponds to the settings in plugins/bPermissions/groups.yml and users.yml, versus anything in the world-specific files. Given you have the login enabled, I AM assuming you are attempting to view the map while the web user has logged in with an ID corresponding to a minecraft ID that you've registered within the game. I'll try to confirm proper function with the current bPermissions tonight. See if you see a difference in behavior if the web user logs in with an account corresponding to a currently online player (within the game) versus a currently offline one.

megge commented 11 years ago

Offline vs online doesn't make any difference. Just tested putting the permission into the "global" file (with use-global-files true), it works there (didn't thnik this through completely, checking the global files is reasonable, sorry that I didn't think of that).

Judging from the behavior, you don't query the permissions "on demand" but cache them onEnable, right? (I can remove the nodes after reload and still have access to the maps) I think this should be fixed, in my case, I only grant specific usergroups access to the hd-map, and therefore this needs to be changeable while running

Yes, with weblogin of course :)

UPDATE: It seems like it doesn't work with use-global-files: true and the permission nodes set in the groups.yml (In my case: Group smod has the nodes, group admin inherits smod, user is of group admin => doesn't work, user has the nodes directly (in users.yml) => works!)

If you are testing: Always reload/restart completely if you change something, bPermissions seems to be kinda selective what to reload on /perm reload

Psy-Virus commented 5 years ago

Old issue, no convo since a thousand years, I guess this is done^^