Solved Give All Permissions (*)

Discussion in 'Plugin Development' started by ThePixelPony, Mar 28, 2014.

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

    ThePixelPony

    Hello. I am making a permissions plugin and all has gone well so far, but I have absolutely no idea about how to implement stars like other permission plugins. For example, if someone listed griefprevention.* as a permission, I'd like to give all permissions that start with "griefprevention.".

    My code so far:
    Code:java
    1. PermissionAttachment attach = player.addAttachment(this);
    2. attach.setPermission("permission.name", true);
     
  2. Offline

    Trevor1134

    ThePixelPony I believe that needs to be set as a wild card, in the .yml. If I may direct you to: http://wiki.bukkit.org/Plugin_YAML this will show you how to use the permission value in the YAML. An example:

    Code:
    permissions:
        griefprevention.*:
            griefprevention.prevent
            griefprevention.anotherperm
     
  3. Offline

    blablubbabc

    The * permissions are meant to be setup by the individual plugin (they can combine permissions nodes in their plugin.yml). Alternativly server owners can setup those kind of permission aliases and bundles themselves via bukkit's permission.yml

    An ultimative "star permission" (all permissions granted) would be similar to the already existing "operator" system.

    If you are looking for automatically creating such star permissions for other plugins then also keep in mind that there are permissions out there which have negative effects for the player, and which are normally marked as 'default: false' then in the plugin.yml.

    I think the way permissionsex for example has implemented their star permission is by hooking into craftbukkits internals and intercepting the permission checks there (I guess).
     
  4. Offline

    ThePixelPony

    Oh, I understand now. So my permission plugin doesn't have to do anything for the * nodes, but the plugins themselves.
     
Thread Status:
Not open for further replies.

Share This Page