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

    Yup, same problem I am explaining above your post. And I only have 1 world on my server.
     
  3. 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.
     
  4. Offline

    imoro

    When will the null error in the cfg be removed?
     
  5. Offline

    jeddeliso

    iTech, i found the root of the problem for mine, its the CraftBook v3.0 alpha2 , if you download the lastest build of craftbook and put nodes of craftbook to your players, it wont say that anymore
    *TO SAY NOW, i have +20 groups*

    nodes include-
    craftbook.mech.*

    all craftbook nodes can be found here -
    http://craftbook.sk89q.com/wiki/Usage
     
  6. Offline

    Danzzz

    just bringing my post back to attention : anyone know a resolution or when the right clicking error will go :( every time one of my players right click they get the message which spans their chat 'You dont have permission to do this'
    ! also my prefixes or suffixes will not work :(
     
  7. Offline

    D5120

    I'm also getting this, I get it when right clicking on doors and chests, however it doesn't stop me from doing anything just spams the chat channel.

    I also have LWC v2.3 installed ? Not sure if this is adding to it ?
     
  8. I have made a little Python script to translate whitelist.txt in Permissions.yml

    Code:
    #!/usr/bin/python
    # -*- coding: utf-8 -*-
    
    #Mask
    config = """    %s
           group: %s
           permissions:
    """
    
    #Whitelist file
    fic = ('white-list.txt')
    
    config_perm = ''
    
    #Asking for world name and group name
    print '-'*50
    print 'Welcome in Whitelist To Permissions script'
    print '-'*50
    world = raw_input('Enter your world name : (case sensitive) ')
    group = raw_input('Enter your group name : ')
    
    #Reading the file
    userlist = open(fic, 'r').readlines()
    
    #Apply the mask and add a :
    for line in userlist:
            config_perm = config_perm + config % ((line[:-1] + ':'), group)
    
    #Write the file
    def write_permissions_yml():
            perm_file = 'plugins/Permissions/' + world + '.yml'
            perm_write = open(perm_file, 'a')
            perm_write.write(config_perm)
            perm_write.close()
    
    write_permissions_yml()
    
    #Work done
    print '-'*50
    print 'Translation done !'
    print 'Thanks for using ;)'
    
    #EOF
    It ask you the world name and the group name, and generate the world.yml permissions file adding all the whitelisted players at the end of the permissions file.

    Have fun ;)
     
  9. Offline

    zaklampje

    Well, agian, no responds... In the beginning, no errors. But when I place or destroy a block, it gives errors... Dunno what to do with that...
     
  10. Offline

    viper1993

    Is here any way to block /give command for certain group using permissions?
    Thanks
     
  11. Offline

    Psycho Robot

    You need to install a plugin which gives items out, since permissions cannot have any effect on default commands. Plugins such as Essentails and DefaultCommands (my personal favorite) will work for you
     
  12. Offline

    Evil_Kitten

    Edit: meh misunderstood
     
  13. Offline

    xZise

    Hello,
    the users of my plugin xWarp has following problem:
    http://forums.bukkit.org/threads/tp-xwarp-v2-7-9-a-mywarp-fork-556-602-617.857/page-8#post-200051

    I'm using only your “getPermissionInteger()”:
    Code:
    public int getInteger(CommandSender sender, PermissionValues value, int def) {
            if (this.handler != null) {
                if (sender instanceof Player) {
                    int result = this.handler.getPermissionInteger(((Player) sender).getWorld().getName(), ((Player) sender).getName(), value.name);
                    return result < 0 ? def : result;
                } else {
                    return def;
                }
            } else {
                return def;
            }
        }
    Now where is the problem? Is it intended and the users has to live with this, or does I use it wrong, or is it a problem in your plugin?

    Fabian
     
  14. Offline

    Bob102316510

    I am having an issue trying to get this to work. I can get everything to load seemingly ok but regardless of what commands I give groups access to they can use commands they shouldnt. for example I dont want my moderator group to be able to use essentials.ban so I didnt include it in their permissions, yet they can still use the command.

    Not sure what I am doing wrong and could use some help. I attached my file just in case

    Thanks
     

    Attached Files:

  15. Offline

    uncovery

    Nope. this was an issue caused by myself. the update from peasant to settler is done with a script I wrote which failed for 2-3 users while I was doing an update. Once I manually changed the user to settler level it worked fine.

    Oh and if you do not believe me I can only invite you over to my server and try for yourself. There is no other "proof" that I can supply except that.

    here is my config.

    http://pastebin.com/mq3eWbHz

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 17, 2016
  16. Offline

    JackTDawson

    So according to the YML your config has No errors just like mine doesn't either. But your saying you can update users to another group with no problems ? Including New people ? Because the groups of the permissions file is what we all are talking about. We cannot update people. So if you got this all figured out, please explain what you did to fix it to the creators of this plugin.. because they might need your help.

    And are you using CB670 and 2.6 of Permissions ? Because this version is what we are talking about.

    I also would love to see it first hand.. I'll see if I can get in there within 10 minutes of this post.

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

    RegaIia

    Alright, I've just about given up on this, I've read through a ton of examples, read tutorials, and used the extent of what I've learned from coding, but I'm not sure what's going wrong. Here's the file I'm using, I don't really have access to the server logs since it's not my server and it's on a dedicated connection, so I don't have the console. Thanks in advance guys, I don't know what's wrong with it.

    Oh, and I have a users section and all, I just didn't think it'd be something that would matter, and figured people would rather not have their usernames thrown about. Anyway, thanks in advance again.
     

    Attached Files:

  18. Offline

    Celtic Minstrel

    Might have been a better idea to just replace all the usernames with User1, User2, etc. At the very least, try removing all but one user to make sure that the error isn't in that section.

    The other thing I would suggest is to ask whoever is running the server to give you console access. Or at least send you the server log.
     
  19. Offline

    uncovery

    Ok after testing around here is the solution: Do not let bukkit/permissions write to your file.
    I have a website w. a PHP script through which the people apply for a new level. In order for the webiste to be able to write to the file, I changed the file ownership to the 'apache'-user. Once I let minecraft write to the file, I would end up with a file that consisted only of

    {}

    So the solution: write-protect your file.

    Created a bug in the bugtracker:

    https://github.com/TheYeti/Permissions/issues/41
     
  20. Offline

    RegaIia

    Haha, well, I have the HUGE document of the server log totaling 116222kb, but I don't really think anyone wants to download all that jazz. I'll switch over the usernames and upload that then.
     

    Attached Files:

  21. Offline

    JackTDawson


    Yes, I have personally seen his server. HE HAS IT WORKING !! Its HOW he did it that is soo ingenious.. I am so happy to be proven wrong here.. Thank you Uncovery for the wonderful tour of your city. Its his PHP website that handles it all. Its amazing.. and of course, that Cathedral you guys hand built.. AMAZING.. I have never seen the like.

    You definitely rock in my books man. I highly recommend everyone to see his server.
     
    uncovery likes this.
  22. Offline

    uncovery

    thanks :)
     
  23. Offline

    zorphon

    I don't know if you ignored my before, but my users aren't allowed to do things that I have GIVEN them permission to do. This has made it unplayable and I want to know how to get this fixed.


    Config: http://pastebin.com/gtFxE6qa
     
  24. Offline

    Tealk

    is it possible to make a special login, so that you get adminstatus by using a password
     
  25. Offline

    JackTDawson

    Well with what uncovery just shown me.. you can use PHP to edit the YML permissions config file. The options are now open.. :)

    The only CON to it is, you must know how to code in PHP for your website.. lmao
     
  26. Offline

    Malkierian

    OK, first things first, you are giving the people who are part of the Admins group more permissions. They don't need any, they've got everything. Anyone who inherits - '*' from their group needs to have nothing else, literally. No other permissions.

    Second, why would you put all those individual permissions instead of just putting them in the groups permissions?
     
  27. Offline

    zorphon

    Good point... but that doesn't change the fact that Keput can't do the things I gave him to do.

    Wait, so if people are in the Admins group they automatically get all permissions? What if I didn't want certain admins to have some config type permissions?
     
  28. Offline

    Celtic Minstrel

    No.

    Then you don't give '*' to admins, or you add '-permission' to those users where permission is the permission needed to use those config things.

    The numbers shouldn't be a problem; it's only a problem if the name contains no letters (eg someone whose name is 23525).

    Perhaps there's a problem somewhere else in the config? Do you get an error on startup?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 17, 2016
  29. Offline

    Malkierian

    EDIT: ninja'd again...
    You see that - '*' in the permissions for the Admins group? That means they have access to every permission node, period. Obviously, this is something you want to give to an EXTREMELY few people. This is why people have multiple groups with varying permissions.
    Now, as to how you can limit, that's where the exclusions come in. If there's a particular node, like perhaps wormhole.build, that you didn't want someone to have you would put this in their individual "users" permissions:
    - -wormhole.build
    With that extra minus just before. This is really what the user permission values are for, the groups are where you put most of the mass of the permissions. Try putting all of the permissions you're trying to give Keput under the Default group permissions, and removing all of those extra permissions underneath the other users (who are admins).
     
  30. Offline

    bizzybusk

    Thats very odd, because its not working if a persons name is Name9191..

    The start up goes like this, (AND I DONT SEE ANY ERRORS, just saying so you dont have to spend any time on it :))

    Code:
    
    
    Having Bukkit problems? Start with just Vanilla. Go!
    2011-04-11 17:34:54 [INFO] WorldGuard: 36 regions loaded for 'world2'
    2011-04-11 17:34:54 [INFO] WorldGuard 5.0-alpha6 enabled.
    2011-04-11 17:34:54 [INFO] [HeroChat] HeroChat version 4.8.6 enabled.
    2011-04-11 17:34:54 [INFO] [HeroChat] Permissions 2.6 found.
    2011-04-11 17:34:54 [INFO] LocalShops: Permissions found.
    2011-04-11 17:34:54 [INFO] LocalShops: waiting for iConomy to start.
    2011-04-11 17:34:54 [INFO] LocalShops: Loading shop Armor
    2011-04-11 17:34:54 [INFO] LocalShops: Loading shop Bakery
    2011-04-11 17:34:54 [INFO] LocalShops: Loaded 2 shop(s).
    2011-04-11 17:34:54 [INFO] LocalShops: version 2.0.1b is enabled!
    2011-04-11 17:34:54 [WARNING] Bukkit version is not the recommended build for Essentials.
    2011-04-11 17:34:54 [INFO] Loaded Essentials build 2.1.25 maintained by Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo and ceulemans.
    2011-04-11 17:34:54 [INFO] Persistence version 0.63 is enabled
    2011-04-11 17:34:54 [INFO] ScrapBukkit version 0.2.1 is enabled!
    2011-04-11 17:34:54 [SEVERE] null loading SpawnMob v1.8.4B (Is it up to date?)
    java.lang.NullPointerException
    at com.jordanneil23.SpawnMob.SpawnMob.loadProps(SpawnMob.java:98)
    at com.jordanneil23.SpawnMob.SpawnMob.onEnable(SpawnMob.java:60)
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:118)
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:511)
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:216)
    at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:94)
    at org.bukkit.craftbukkit.CraftServer.loadPlugins(CraftServer.java:72)
    at org.bukkit.craftbukkit.CraftServer.reload(CraftServer.java:264)
    at org.bukkit.command.SimpleCommandMap$ReloadCommand.execute(SimpleCommandMap.java:196)
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:80)
    at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:233)
    at net.minecraft.server.NetServerHandler.c(NetServerHandler.java:594)
    at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:557)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:551)
    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)
    2011-04-11 17:34:54 [INFO] WorldEdit nightly enabled.
    2011-04-11 17:34:54 [INFO] WorldEdit: Permissions plugin detected! Using Permissions plugin for permissions.
    2011-04-11 17:34:55 [INFO] [iConomy] Configuration Integrity Start:
    2011-04-11 17:34:55 [INFO] - System.Currency_Plural is null or missing, Defaulting to: Coins
    2011-04-11 17:34:55 [INFO] - System.Interest.Announce is null or missing, Defaulting to: false
    2011-04-11 17:34:55 [INFO] [iConomy] Configuration Integrity End.
    2011-04-11 17:34:55 [INFO] [iConomy] Logging is currently disabled.
    2011-04-11 17:34:56 [INFO] [iConomy] v4.63 (Kenzi) loaded.
    2011-04-11 17:34:56 [INFO] [iConomy] Developed by: [Nijikokun, Coelho]
    2011-04-11 17:34:56 [INFO] [HeroBounty] iConomy 4.63 found.
    2011-04-11 17:34:56 [INFO] LocalShops: Attached to iConomy.
    2011-04-11 17:34:56 [INFO] [iConomy] hooked into Permissions.
    2011-04-11 17:34:57 [INFO] [Hawox's uQuest] Loaded with Flatfile!
    2011-04-11 17:34:57 [INFO] [Hawox's uQuest] v1.03 enabled! With 53 quests loaded!
    DONE
    
    
    And its kinda odd if there would be an error in the config since im able to add players without numbers.
     
  31. Offline

    Celtic Minstrel

    I don't see Permissions loading anywhere in there.
     
Thread Status:
Not open for further replies.

Share This Page