Bug with permission and PermissionAttachment

Discussion in 'Plugin Development' started by Kilorbine, Mar 13, 2015.

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

    Kilorbine

    Hi guy,

    I'm currently working on permission, I think that i made everything correct but it seem not.

    Can you help me?

    Code:
    PermissionAttachment attachment = e.getPlayer().addAttachment(SafeTnt.me);
        attachment.setPermission("SafePerm",false);
        SafeTnt.me.permissionMap.put(e.getPlayer().getName(), attachment);
       
        
        Map<String, Boolean> test = SafeTnt.me.permissionMap.get(e.getPlayer().getName()).getPermissions();
        if (test.get("SafePerm") == null)
            e.getPlayer().chat("error");
    Badly, everytime I make a getPermissions().get("SafePerm") it return null

    I really don't know what's going wrong here
     
  2. Offline

    xTrollxDudex

    Please show the entire context of your code.

    Edit: I'm hinting at an underlying problem, if you had not used static you probably would have avoided this problem.
     
    mine-care likes this.
  3. Offline

    Kilorbine

    finally found : forget to add permissions in the pluginManager
     
Thread Status:
Not open for further replies.

Share This Page