Toggle op permissions without editing plugin.yml?

Discussion in 'Plugin Development' started by afistofirony, Sep 17, 2012.

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

    afistofirony

    Let's say I want to have an option where I can toggle whether ops have all permissions for my plugin.

    I assume that this could be done with a piece of code like this:

    Code:java
    1. if(sender.hasPermission("permission.node")||(config.getValue("general.op-permissions" == true)&&sender.isOp)



    Of course, this piece of code is probably incorrect, but I'm curious if something like this is possible.

    Thanks in advance! :)
     
  2. Offline

    kyle1320

    afistofirony
    Try this
    Code:
    getServer().getPluginManager().getPermission("my.permission").setDefault(PermissionDefault.OP);
     
    afistofirony likes this.
  3. Offline

    afistofirony

    Okay, thank you! :D
     
Thread Status:
Not open for further replies.

Share This Page