permission nodes that don't exist?

Discussion in 'Plugin Development' started by Malikk, Oct 16, 2012.

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

    Malikk

    Hey guys,

    I'm running permissions checks based on a yml file like normal, but when I do a check on a node that shouldn't exist, sometimes it returns true and sometimes false. (I'm checking for nodes that don't exist because the part of the node that I do know could be in one of two parent groups and it's too many to check which group it should be in.)

    Obviously, since one of the groups sometimes returns a false true, this is messing up all my permissions checks. Does anyone know of a way to check if a node is listed in the yml or of another way to solve this problem?

    Thanks in advance.
     
  2. Offline

    CorrieKay

    the node should only return true (while not existing) if they have OP, i think.
     
  3. Offline

    Malikk

    That makes sense. However, I'd still like for it to return false in all cases if it doesn't exist, regardless of OP status. Any ideas?
     
  4. Offline

    Malikk

    Anybody?
     
  5. Offline

    Malikk

    bump...
     
  6. Ispermissionset(permission node);
    That will tell you if it overrides it's default setting
     
  7. Offline

    Malikk

    I assumed that only tells you if the server has set that permission, not whether the node is specifically defined in my plugin.yml. Would that work to help me determine whether or not a node should exist?
     
  8. This is from Permissible.isPermissionSet(String)
    Player implements Permissible.

    so where you check the permission.

    if(playerObject.isPermissionSet(Permission) && playerObject.hasPermission(Permission)){

    //do STUFF
     
  9. Offline

    Malikk

    The docs say "Checks if this object contains an override for the specified permission", so I don't think this is what I want. Your suggestion checks if the server has overridden the way I have set the permission to default, not whether or not the node exists.

    With your current code, permissions that default to true would not pass that if statement. I don't really care whether or not they've overridden the default, all I wanna do is check whether a permission node exists in the plugin.yml (not the permissions.yml).
     
Thread Status:
Not open for further replies.

Share This Page