Inactive [ADMN/DEV] Permissions v2.7.4 (Phoenix) - DISCONTINUED! 3.0 has a new home!

Discussion in 'Inactive/Unsupported Plugins' started by TheYeti, Feb 25, 2011.

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

    TheYeti

    Permissions 2.7.4 (Phoenix) - Now with AntiBuild built in!
    Download:
    Latest Stable: Full Zip | Jar Only
    Latest Dev Build: Full Zip | Jar Only
    Previous Versions: 2.7.3 (JAR) | 2.7.2 (JAR) | 2.7.1 (JAR) | 2.7 (JAR) | 2.6 (JAR) | 2.5.5 (JAR) | 2.5.4 (JAR) | 2.5.3 (JAR) | 2.5.2 (JAR) | 2.5.1 (JAR) | 2.5 (JAR) | 2.4 (JAR) | 2.3 (JAR) | 2.2 (JAR)

    Plugin Authors: How to hook into Permissions

    Permissions 2.x is being discontinued! 3.0 can be found HERE!!!


    I am discontinuing Permissions 2.x and leaving the project. Permissions is not going away though! Since 2.6 I have been working closely with another developer and added them to the team. For the past several version they have not only been assisting with 2.x but also doing a lot of the development of much anticipated 3.x. rcjrrjcr will be taking over as lead developer of Permissions from 3.x forward. I have full faith in them and after working closely with them on the development on the last few version and the next major version I feel that I am leaving this project in more than capable hands. I put way to much work into this project to just leave it with anyone, and this is one of the few programs that I am incredibly proud of.

    Many people will probably wonder why I am leaving again after taking over the project just a few months ago. I could quote drama and headaches, of which there were quite a few with this project. Unfortunately real life happens. Many people already know that I have been having medical issues here lately. Unfortunately while they have gotten better, they have not gone away. This coupled with other real life commitments, going to school full time, and starting up my own company, I am currently in the process of being laid off from work. At this point I have so much stuff going on in my life and am being pulled in so many directions that I am not able to get any work done on anything. This has lead to me missing commitments and letting people down on multiple things.

    Permissions is also a very high maintenance plugin that requires a lot of attention and time. Right now I am not able to devote that time and do not feel it is fair for me to try to continue to be the lead developer on it. I had originally thought that adding other members to the team would be helpful, but unfortunately this just lead to frustration for them and myself as I just was not able to commit to the project enough. Hence, 3.0 has been rewritten almost exclusively by rcjrrjcr with minimal contributions by myself.

    At this point I will be stepping away from the project to focus more on real life and to try to free up some time for other projects and to work with more individual like the wonderful HeroCraft Coding team to fulfill some commitments that I made to them a long time ago and sadly did not come through on. I feel that this is the best for all involved, both myself and the other Permissions developers, as well as the community who deserve someone who can contribute more time and attention to them and supporting them. I do not want to see Permissions end up like many other plugins with an absentee programmer and just slowly wasting away from a great plugin with a lot of potential to a headache with no support.

    I will still be active in the community, just not as much as not in the same way. I'm sure my server will be more than happy to have their head admin back and active again as well.

    Thank you and happy gaming.




    Changelog
    • 2.7.4
      • Added overload of has() and permissions() for plugin devs
    • 2.7.3
      • Fixed negate node add/remove bug.
    • 2.7.2
      • Fix for small subtle bug introduced in last minor version.
    • 2.7.1
      • Commit by DThielke to fix several bugs with programmatic modifications of user permissions.
    • 2.7
      • Further commits by rcjrrjcr
        • Removed negatedNode checks
        • Temp fix for NULL issue
        • WorldConfigurationModification to save only modified configs
        • Fix for cache problems
    • 2.6
      • Pulled in commits by rcjrrjcr
      • Fixed versioning. Last version should have technically been 2.6
      • Fixed invalid config file being written
      • Fixed erroneous conversion message.
    • 2.5.5
      • Updated to be compliant with CB600+
      • Further Maven Integration and Autobuilding
      • Better handling of configuration file errors.
        • If you do not have a world config file for the default world at startup it will now look for config.yml
        • If it cannot find that it will look for world.yml instead in case you named it that when that is not what is in level-name:
        • It will rewrite the config file to be the proper name. At this time it does not delete the old one though.
      • Removed defunct public abstract calls. If your not using the right one by now you should be shot anyway.
    • 2.5.4
        • Added Command aliases for perms and pr
        • Changed the way directories are handled.
        • Stopped it from creating an empty <world>.yml file in base directory
        • Moved project to using Maven.
    • 2.5.3
      • Change from File.pathSeparator to File.separator to fix multiworld perms
    • 2.5.2
      • Added more instructions to the included config file within the plugin
      • Added a check that will use the default world permissions if a world specific config file cannot be found.
      • Added a function to get only the group that a player is assigned to without checking for group inheritance.
      • Added a change to colorize() to fix it hopefully not adding an extra unneeded ascii character and thus creating a linebreak/color switch issue
      • Removed permissions.info as it was not needed and was a artifact of testing I was doing.
    • 2.5.1
      • Fixed a bug that could cause a group to be returned as null for getGroups()
    • 2.5
      • Added in AntiBuild functionality to Permissions
      • Minor code tweaks
      • Added getGroups(world, player) to PermissionHandler so that plugins can call it to get all of a users groups
      • Fixed the inability to use the permissions -reload all command from within the console. I still need to do some more work on this as it doesn't seem to like to accept anything other than all from console.
    • 2.4
      • Refactored namespaces to keep in line with Java & Bukkit policy
        • This was cancelled as it ended up being not needed
      • Fixed setupPermissions()
    • 2.3
      • Undid removal of some code that I had overzealously purged during cleanup
      • Merged in last of Nijikokun's changes
      • Re-ordered the main class to attempt to fix the problems with Plugin API
    • 2.2
      • Developer change
      • Fixed reloading of configuration files
      • Moved commands to registering with plugin.yml
      • Commands now use onCommand instead of onPlayerCommand
      • Command is now /permissions instead of /pr
    [/SPOILER]
     
    mruczek, kahlilnc, Pii and 58 others like this.
  2. Offline

    JackTDawson

    ok .. here is the problem.. I checked.. Its NOT World Guard or World Edit.. I removed them both and still cannot upgrade people in rank. Still have same issues with permissions.. in fact right now this is what I am using.. even fresh install and re-entered their names..

    Essentials.jar, Essentials.Chat, Essentials.Spawn, Essentials.Protect ( 2.1.28 )
    Permissions 2.6
    Bukkit 670

    None of these gives java errors until I try to use the PR command. So I can only use the Reload command.. which doesn't work either since permissions never updates the ranks for anyone. All the older people somehow are still their ranks and they have their access just fine.. but new people cannot update at all.

    I have tested the YML files with YML parser and Notepadd ++

    Nothing found wrong in either one. NULL is still all over the place though.

    So again.. back to drawing board guys.. Permissions still wont work correctly since it wont update ranks. And this is the MAIN problem it seems everyone is having.

    I have tried rebooting server as well as replacing files. Nothing works. Those who have their ranks already, the permissions is working fine.. but those who are new.. some how cannot update. I am thinking that Permissions OR Bukkit is writing out a file somewhere to store previous permissions somehow. I already know it rewrites the YML file out every time you stop the server. I replace the file while server is down and still no changes.

    So bottom line, its NOT WG / WE. or any other plugin.. it IS permissions.. I wish Notch would just add permissions to the server and we could be done with this problem already.
     
  3. Offline

    ITech

    I tryed to reduce it to three groups, but it did not work
     
  4. Offline

    rcjrrjcr

    Update ranks? What do you mean? If you are referring to the (add|remove)UserPermission methods, those are currently bugged. I made a typo there.
     
  5. Offline

    Mrjibidi

    why this new permissions version is not working for meeeeee?
     
  6. Offline

    JackTDawson

    yes I was referring to changing Groups. Example.. going from the noobie group to the citizen group.. citizen having the permission to build. ( Lot of us call them ranks in some servers )

    EDIT : so basically what your saying is its a bug and we all should just wait until the bug is fixed ? Not trying to be a dick here.. its just been hard for new ones to come into a server and they cannot do anything.. or if I shut down permissions.. the grievers come tear up all our hard work. Its a No-Win scenario.
     
  7. Offline

    1994mat

    Plz dis realy needs to be fixed, or is it multiverse's problem?
     
  8. Offline

    JackTDawson

    Its why I use essentials.. essentials blocks water and stuff like that if you need too. Sad part.. it's the only plugin that DOES work with permissions. And they update it almost everyday.

    EDIT : I even put item 95 in when notch decided to be a dick and put in the april fools joke. He SAYS he took it out.. but I keep 95 in the essentials block list anyways.
    http://www.minecraftwiki.net/wiki/Locked_Chest
     
  9. Offline

    rcjrrjcr

    The problem here is that I have submitted the fix already, but TheYeti hasn't accepted my code yet.
     
  10. Offline

    JackTDawson

    I understand.. Thanks for at least trying bro.. :/
     
  11. Thank you for spending your time trying to help me out. I reinstalled a fresh 2.6 permissions and when I loaded the server, no errors. Then, when I installed my world.yml file, i got errors again. I attached my server log and my world.yml if anyone has any ideas.
     

    Attached Files:

  12. Offline

    rcjrrjcr

    The "build: true" entry is indented too much. Change it from this:
    Code:
    suffix: ''
        build: true
    
    to this:
    Code:
    suffix: ''
    build: true
    
     
  13. Offline

    Tealk

    hi, if i edit my world.yml and restart my server it all time become a roll back why????
     
  14. Offline

    JackTDawson

    Its the same bug I was referring too in my description above. Not to mention the Groups problems. Which rc said he submitted code to fix for. We are waiting on the Main Coder to see it.
     
  15. Offline

    rcjrrjcr

    Don't edit your world.yml when the server is running. If you really want to edit it, do it when the server is offline or use "/pr -reload all".
     
  16. Offline

    JackTDawson

    By the way.. that reminds me.. the "/pr -reload all" doesn't work for me. And I have not met anyone that said it worked for them either. All I get is "You don't have permissions to use it" and I'm the server admin.. lmao
     
  17. Offline

    rcjrrjcr

    You need the "permissions.reload" permission. Though I suppose you have '*'.
     
  18. Offline

    JackTDawson

    I have it. Still doesn't work. Here is a thought.. you think its not including itself when I do :

    - 'permissions.*'

    Do I also need to add :

    - 'permissions.reload'

    to the admin section as well ?

    EDIT : Never mind.. didn't work even when I added it as a separate line. And yes I tried the - '*' and still no changes.
     
  19. Offline

    rcjrrjcr

    Seems to work for me, though this is on my test server, with only iConomy, Permissions, BeanShellDebugger and my own plugin.
     
  20. Offline

    JackTDawson

    I only have Essentials and Permissions running.. and I try to use it to reload permissions so I can add members without rebooting server.. but that's part of the problem I guess.
     
  21. Offline

    rcjrrjcr

    Try it without the quotes. The wildcard works fine for me. Can you try reloading from the console?
     
  22. Offline

    JackTDawson

    yes.. I tried from console.. it JAVA errors when I do.. and i'll try it without quotes.
     
  23. Offline

    rcjrrjcr

    Can you post the exception?
     
  24. Ok I changed that and I also found some random 'tab' after a line. I now have my permissions2.6 working on 670.

    Here is my Server log and world.yml

    Thanks to everyone who helped
     

    Attached Files:

  25. Offline

    Malkierian

    @Crapsac Von Stinkbag There was another place where build:true wasn't indented enough, down in governor. You might want to think about fixing that too.
     
  26. Offline

    Imitation

    Last I checked negative permissions on mirrors doesn't work at all but AFAIK TheYeti is aware of this.
     
  27. Offline

    JackTDawson

    ok here you go..

    Show Spoiler

    11:26:20 [INFO] Starting minecraft server version Beta 1.4
    11:26:20 [INFO] Loading properties
    11:26:20 [INFO] Starting Minecraft server on *:25565
    11:26:20 [INFO] This server is running Craftbukkit version git-Bukkit-0.0.0-646-
    gb61ef8c-b670jnks (MC: 1.4)
    11:26:20 [INFO] Preparing level "wonderworld"
    11:26:20 [INFO] Preparing start region
    11:26:20 [INFO] 144 recipes
    11:26:21 [INFO] [Permissions] (Phoenix) was Initialized.
    11:26:21 [INFO] Loaded Essentials build 2.1.29 maintained by Zenexer, ementalo,
    Aelux, Brettflan, KimKandor, snowleo and ceulemans.
    11:26:21 [INFO] Loaded EssentialsChat build 2.1.29 by Zenexer, ementalo, Aelux,
    Brettflan, KimKandor, snowleo and ceulemans.
    11:26:21 [INFO] Loaded EssentialsProtect build 2.1.29 maintained by Zenexer, eme
    ntalo, Aelux, Brettflan, KimKandor, snowleo and ceulemans.
    11:26:21 [INFO] Loaded EssentialsSpawn build 2.1.29 maintained by Zenexer, ement
    alo, Aelux, Brettflan, KimKandor, snowleo and ceulemans.
    11:26:21 [INFO] [Permissions] version [2.6] (Phoenix) loaded
    11:26:21 [INFO] Done (0.095s)! For help, type "help" or "?"
    >pr -reload all
    11:26:45 [INFO] All world files reloaded.
    11:28:02 [INFO] JackDawson has logged in for the first time.
    11:28:14 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'pr'
    in plugin Permissions v2.6
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80
    )
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:2
    54)
    at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:596)
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:559)

    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:553)
    at net.minecraft.server.Packet3Chat.a(SourceFile:24)
    at net.minecraft.server.NetworkManager.a(NetworkManager.java:198)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:72)
    at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
    at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:368)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to jav
    a.lang.String
    at com.nijiko.permissions.Control.load(Control.java:216)
    at com.nijiko.permissions.Control.forceLoadWorld(Control.java:115)
    at com.nijiko.permissions.Control.reload(Control.java:81)
    at com.nijikokun.bukkit.Permissions.Permissions.onCommand(Permissions.ja
    va:245)
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
    ... 12 more
    >


    Also, when I tried to take out the quotes around the * it crashed permissions altogether. So I put them back and its coming up with no errors on start.. UNTIL I try to do it in game. Then I came up with the above JAVA error.

    In the console.. because I updated essentials to 2.1.29, the console reload command shows that it worked.. but nothing changed when I tried to change a group for someone. Also I am wondering if there is a conflict between Essentials.Protect and Permissions.
     
  28. Offline

    FloydATC

    "/pr -reload all" fails in 2.6 because of the new per-player files, I now have to manually reload each world or this happens:
    Code:
    17:27:10 [SEVERE] null
    org.bukkit.command.CommandException: Unhandled exception executing command 'permissions' in plugin Permissions v2.6
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:37)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80)
            at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:254)
            at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:596)
            at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:559)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:553)
            at net.minecraft.server.Packet3Chat.a(SourceFile:24)
            at net.minecraft.server.NetworkManager.a(NetworkManager.java:198)
            at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:72)
            at net.minecraft.server.NetworkListenThread.a(SourceFile:100)
            at net.minecraft.server.MinecraftServer.h(MinecraftServer.java:368)
            at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:283)
            at net.minecraft.server.ThreadServerApplication.run(SourceFile:375)
    Caused by: java.lang.NullPointerException
            at com.nijiko.permissions.Control.load(Control.java:146)
            at com.nijiko.permissions.Control.forceLoadWorld(Control.java:115)
            at com.nijiko.permissions.Control.reload(Control.java:81)
            at com.nijikokun.bukkit.Permissions.Permissions.onCommand(Permissions.java:245)
            at org.bukkit.command.PluginCommand.execute(PluginCommand.java:35)
            ... 12 more
     
  29. Offline

    Malkierian

    OK, well, first off, you don't even have your Ambassadeur group inheriting anything, and I'm assuming it's higher than VIP, so you'll want to put VIP on the inheritance line for Ambassadeur.

    However, if inheritance is messed up, then probably this won't help you until it's fixed.
     
  30. Offline

    JackTDawson

    Yup, same problem I am explaining above your post. And I only have 1 world on my server.
     
  31. Offline

    Celtic Minstrel

    Somehow, a control character has snuck into your file. I have no idea how that could happen.
    Oh, good to know that Notepad++ displays invisible characters.

    Why would you even need to do something like this? It would have the exact same effect as just giving 'worldedit.suparpickaxe', unless of course you also gave '*' earlier.

    Oh, definitely.

    Isn't there EssentialsGroupManager which is basically the same plugin but actually being updated?

    Any chance this can/will be implemented?[/quote]

    He's referring to the thing many people are saying that if you give a permissions node twice, either explicitly or implicitly, it doesn't work. For example, if you give '*' followed by any other node, or if a group with a permission inherits from a group which also has that permission.

    Anyway, @TheYeti and @rcjrrjcr - read on!

    I had a look at the source code, and there are a few odd things that I feel should be corrected or reconsidered. For starters, PermissionHandler has too many methods.

    Code:
    public abstract void load(String world, Configuration config);
    This method is never used from the Permissions class, and the signature does not make sense. I see that it's used in the Control class, but there it's a part of the internal implementation and should not really be exposed in PermissionHandler. Recommendation: Remove it from PermissionHandler.

    Code:
    public abstract boolean loadWorld(String world);
    public abstract void forceLoadWorld(String world);
    Again, as I see it, these are part of the internal implementation; the external interface to what they do would be reload(String world). Obviously they are needed in Control, but in PermissionHandler I think they are just needless clutter. Recommendation: Remove them from PermissionHandler.

    Code:
    public abstract boolean checkWorld(String world);
    Maybe consider a rename on this one? I almost included it with the above pair as a function that shouldn't be included, but then I realized that what it does could be useful for a plugin hooking into Permissions. Recommendation: Consider a more descriptive name like hasWorld or something.

    Code:
    public abstract void setCache(String world, Map<String, Boolean> Cache);
    public abstract void setCacheItem(String world, String player, String permission, boolean data);
    public abstract Map<String, Boolean> getCache(String world);
    public abstract boolean getCacheItem(String world, String player, String permission);
    public abstract void removeCachedItem(String world, String player, String permission);
    public abstract void clearCache(String world);
    public abstract void clearAllCache();
    These seriously have no business being in PermissionHandler. A plugin hooking into Permissions shouldn't care about the cache. They generally just care about getting at the info. The cache is part of the internal implementation, not part of the interface. Recommendation: Remove them from PermissionHandler.

    Code:
    public abstract boolean has(Player player, String permission);
    This is an alias for the permission(Player,String) function. PermissionHandler is an abstract class. Why not put the implementation of this in PermissionHandler? It would be a little less trouble if someone wanted to write their own PermissionHandler to replace the Control class. Recommendation: Move the implementation from the Control class up into PermissionHandler.

    Speaking of people writing their own PermissionHandler, I've started to do just that, because I get the impression that the code in the Control class is way more complex than it needs to be. Of course, my impression may change once I've done it. :p

    And the final point is the get{User,Group,}Permission{Boolean,Integer,Double,String} functions. They get their data, not from the permissions node, but from... the info node? Why? The info node is for permissions now? Okay, there's one there already (build), but there's also stuff there that's not permissions (prefix, suffix); it seems to me that mixing them like that is not a good plan. Honestly I think it would be more intuitive just to include it in the permissions node, though that might be a bit difficult from a programming perspective since until now it has been a list of exclusively strings. The other alternative would be to make a new node for permissions with values. Maybe call it "valperms" or "valuepermissions".

    Also, you should add List, IntList, StringList, possibly DoubleList, and Map as possible types. (The Map type should probably return a ConfigurationNode.) You could also consider MapList, but that might be going too far.

    EDIT: Oh, almost forgot... I'm sure some people would like "ops" as a top-level node besides "groups" and "users"; it would have the same subnodes as the individual user nodes and allow people to specifically give permissions to ops, make ops inherit permissions from other groups, and stuff. I personally see no reason to restrict ops at all, and such a system would not work for those plugins that check for isOp before checking permissions, but some people seem to disagree with me.
     
Thread Status:
Not open for further replies.

Share This Page