Some permissions problems

Discussion in 'Plugin Development' started by bendem, Aug 10, 2013.

Thread Status:
Not open for further replies.
  1. Hi,

    I'm new in bukkit dev and I got some problems with my permissions
    Here is my actual plugin.yml : http://pastebin.com/xhvftan5
    What I want is that anybody would be able to use "/lr" to display informations but only op can use the two other command...
    In my code, I correctly used the hasPermission method, but when I'm not op, it keep saying I don't have permission to use "/lr" (even with lr. display: default: true)...

    Would be happy if someone could give me the obvious answer ;-)
     
  2. Offline

    Sabersamus

    For something like this, instead of handling one permission in your plugin.yml, handle it in the code

    Code:
    if(args[0].equalsIgnoreCase("reload")){
        if(player.hasPermission("lr.reload")){//will return true if has lr.*
            //do stuff, im sure you get the idea
        }
    }
     
  3. That's what i did, but i'd like is that by default, users are able to issue /lr and op are able to issue /lr, /lr reload, /lr chance...

    Here's what i wrote : http://pastebin.com/7SnrfzXx

    Ok I just understood what I really want : Is there a way for users to get lr.display permission by default ?

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

    Sabersamus

    in plugin.yml define lr.display and set default to true
     
  5. I setted this before posting, and I posted here because it doesn't seem to work...
    Here's my plugin.yml again :
    Code:
    permissions:
        lr.*:
            description: Give access to all LessRain commands
            children:
                lr.display: true
                lr.reload: true
                lr.set: true
        lr.display:
            description: Display chances to cancel rain
            default: true
        lr.reload:
            description: Reload config from file
            default: op
        lr.set:
            description: Set Chances to cancel rain (integer)
            default: op
    no one have an idea of what's going on (maybe a bukkit bug) ?

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

    Sabersamus

    what does the command look like in plugin.yml?
     
  7. My first post contains a link to my plugin.yml...
     
  8. Offline

    Sabersamus

    Yes but it may have been changed since you first did it.
     
  9. Up, no one else has an idea of what's going on ?
     
  10. Offline

    SainttX

    bendem If you're using a permissions plugin you may need to check for permissions using Vault.
     
  11. Offline

    mattrick

    Actually, no. Using Vault permissions is the same as using SuperPerms.
     
  12. Offline

    SainttX

    mattrick16 Interesting. When making a plugin and .hasPermission() wasn't doing anything for me, hooking into Vault solved the issue.
     
  13. Offline

    mattrick

    Are you not an OP on your server? Works fine for me....
     
  14. Offline

    Sabersamus


    vaults hasPermissions calls bukkits hasPermissions. I don't think Vault solved the problem, I think something you did along the way solved the problem.
     
Thread Status:
Not open for further replies.

Share This Page