Vault - A Permissions/Economy API - alternative to Register [STABLE]

Discussion in 'Resources' started by Sleaker, Oct 21, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Sleaker

    The main project page is here:
    http://dev.bukkit.org/server-mods/vault/

    This is an alternative to the often complained about complexness of Register - it also contains an evolving (that means changing and getting better) Permissions layer for use with plugins that would like to support nearly any of the optional permission stuff - such as transient permissions, groups, mutable persisted permissions, chat and info nodes.

    Check it out. We're always looking for people to expand on it, so fork and submit pull requests to make it better!
     
  2. Offline

    kaiser_czar

    Gotta say, the sheer amount of permissions support is beautiful. I'd almost say that the econ side is a bit too simple, but everything you could need to do is still possible. Nice work, I'll be tryin' this out.
     
  3. Offline

    DomovoiButler

    your missing the checkGroups or getAllGroups...or did i missed it?(on permissions)
     
  4. Offline

    Sleaker

    abstract public boolean playerInGroup(String world, String player, String group);
    abstract public String[] getPlayerGroups(String world, String player);
    abstract public String getPrimaryGroup(String world, String player);
    abstract public boolean groupHas(String world, String group, String permission);

    are those what you were looking for @DomovoiButler ?
    I'll be splitting off all the chat/info node API soon and tagging the old Permission methods for that stuff as deprecated - that way I don't have to deal with unsupportedoperationexceptions when people use incompatible permissions and try to get chat/info stuff - the mutable permission stuff may need some work for bPermissions/BukkitPerms and right now bPerms isn't explicitly supported (it just gets handled as a superperms plugin)
     
  5. Offline

    DomovoiButler

    @Sleaker :( i guess its not been implemented yes
    what i was looking for is to get all the groups on a permission plugin
    for example: on PEX permissions, i want to get all the groups in PEX...from the member to admin or something like that
     
  6. Offline

    Sleaker

    ahhh - I can add in something like that, shouldn't be too hard - though it'll be completely impossible in SuperPerms

    @DomovoiButler - latest build has it

    If you have any suggestions on additions to the economy API let me know, right now there's really only 4 methods, format, has, withdraw, deposit

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 20, 2016
  7. Offline

    codename_B

    Needing help with bPermissions support?
     
  8. Offline

    kaiser_czar

    In truth, what you have is really all you need; I'm used to having the million convenience methods from Register, such as set, hasOver, and other things like so. It's really not crucial at all to add them.
     
  9. Offline

    Sleaker

    Sounds good! - I do think we need to add the bank methods though. so i added that to the things to do :)

    @codename_B - if you want to implement the methods for it and submit a pull, I wont stop you. It'd be best if you did it on the Chat branch.
     
  10. Offline

    codename_B

    Heh, I'm too busy to do a proper decent pull request atm but I'll add it to my todo list.
     
  11. Offline

    Sleaker

    no problem @codename_B - I'll probably get around to doing some stuff with it later tonight.
     
  12. Offline

    Sleaker

    Vault now has full bPermissions support, a full Chat/InfoNode API and Bank methods have been added for plugins that need banks (though only BSE/iC06 support banks atm)
     
  13. Offline

    thehutch

    Ok so may I ask what this will actually offer us then which will differ to register? and what that one paragraph explains? Also what its uses will be for? Thank you
     
  14. Offline

    Sleaker

    Simpler API than Register -
    Continuous updates to make sure it stays current with Bukkit, and Economy/Permissions development
    It is intended 100% as a standalone plugin, not an included library - which solves the issue of Conflicting classes, caused by plugin developers including Register in their plugin rather than linking seperately.
    It uses the services manager - so it will register and use whichever econ/perm/chat API that has highest priority if it sees more than 1.
     
    thehutch likes this.
  15. Offline

    desht

    I'll vouch for Vault here. I've just moved the dev branch of my ScrollingMenuSign plugin over from Register to Vault. Took 5 minutes, completely painless, thanks to the good docs for Vault on dev.bukkit.org. Right now, I see three big advantages over Register:
    1. Vault has a much simpler setup process (no need to create your own server listener).
    2. Too many plugins have included Register statically, and gotten it wrong. That just breaks Register for every other plugin on the server that uses it.
    3. Nijikokun doesn't seem interested in keeping the documentation for Register up to date and has been pretty much inactive on the Register forum thread, despite many problem reports. That's not the sort of plugin I want to be depending on. As long as @Sleaker & the other Vault devs stay active, I'll be a lot more comfortable using Vault in my plugins.
     
  16. Offline

    codename_B

    bPermissions now supports per-player permissions.

    This is achieved through pseudo-groups as of bPermissions v1.8.0

    Code:
    players:
        codename_B:
        - default
        - p:bPermissions.build
    
    As you can see there I'm in the group default, as well as having the extra permission node "bPermissions.build".
    All without changing the bPermissions API.

    Hope you find this useful to incorporate into the next Vault update :)
     
  17. Offline

    Sleaker

    err but how are we supposed to add/remove per-player permissions if there was no API addition? :eek:
     
  18. Offline

    codename_B

    By adding/removing the per-player group.
     
  19. Offline

    Sleaker

    ah gotcha - is there a special name for it? - I don't use bPermissions so the syntax on how you write to file/read doesn't mean much to me.
     
  20. Offline

    codename_B

    WorldPermissionsManager wpm = Permissions.getWorldPermissionsManager();
    PermissionSet ps = wpm.getPermissionSet(world);

    The api methods are all based around the PermissionSet :)
     
  21. Offline

    notrub

    Let me start by saying Vault is Great!
    I am new to fairly new to bukkit plugin programming and need some help.
    I got it up and running easily, to the point of giving money on a command. The trouble is I want it to run under a PlayerListener class, specifically onPlayerInteract method. How do I get my economy variable to work in that class? Any help is appreciated.
     
  22. Offline

    Sleaker

    If you followed the directions on the main plugin page the economy variable should be static - this means there is only 1 instance of it at a time, and it can be accessed Statically from anywhere in your project via PluginName.economy

    If your project is released I'll add it to the list of Vault-Supported plugins, just let me know!
     
  23. Offline

    notrub

    That was incredibly more simple than I was making it. Thanx for the fast response!
     
  24. Offline

    Sleaker

    No problem at all! The intent is to make it simple, but powerful :)
     
  25. Offline

    undeadmach1ne

    very cool. thanks for all your work on this :) i will definitely use this instead of register next time (or if i ever make a plugin that requires permissions lol).
     
  26. Offline

    Don Redhorse

    I moved 2 projects over to vault, quite painless.. I will use it probably to add enhanced permission support to another plugin of mine.

    I really like the plugin as it does something which I also wanted to do... even if my idea where a little bit more farreached..

    The plugin is very coder and admin friendly and the developers are quite helpful.. thanks..
     
  27. Offline

    Smex

    Dude's this masterpice is so ass simple, if you mess up on it,
    you shouldn't even make plugins. Thanks. ;)
     
  28. Offline

    desht

    Is Vault available in a Maven repo anywhere? I finally took the plunge and decided to learn Maven :)
     
  29. Offline

    Lolmewn Retired Staff

    Soo.. If I put this in my project instead of Register, will the Eco stuff break?
    I'm assuming it will, but how hard will it break?
     
  30. Offline

    Sleaker

    @desht - we don't use maven for any of our projects - just ant. Haven't needed/wanted to learn how to use maven as ant suffices.

    @Lolmewn - you'd need to adjust all the methods and change them to use Vault's. Vault doesn't use any of the same API that register does.
     
Thread Status:
Not open for further replies.

Share This Page