Solved Permission set default to true?

Discussion in 'Spigot Plugin Development' started by Pannkaka, Apr 22, 2017.

  1. Hello!

    I don't know if i have misunderstood this or not but if you set the default option for a permission to true will the player always "have" that permission even if the technically doesn't have it as it's set the to true as default. But why would you want to check if a player has a permission that every player will have regardless?
     
  2. Mas

    Mas

    Yes, setting a permission's default value as 'true' means everyone will have that permission by default.
    This is useful in cases where you want everyone to be able to do something by default, but a certain rank/group not be able to do something (by excluding the permission from certain people).

    For example:
    You have a permission called 'myplugin.afk' which allows you to use an /afk command. This permission's default value is true.
    You have a guest rank on your server for people who have not registered or whatever, and you don't want them to be able to use the afk command, so you explicitly disable this permission for them.
    All the non-guests can now use /afk like normal, but the guest rank can't.
     
    • Useful Useful x 1
  3. Yes, that makes a lot of sense. Thanks for the answer! :)
     
    • Friendly Friendly x 1