Custom permissions?

  • As @zfoxfire mentioned here, the ability to store in permission groups custom tags and values and to query them from plug-ins (for instance, via Player.getPermissionValue()) could be useful.


    I am sure @zfoxfire will add rationales and relevant use cases, I'll simply note that some of this is already implemented and only some piece is missing.


    A) It is already possible (I tried) to add arbitrary tags and values in permission group files, as long as they conform to the general syntax of:
    <tag>: <value>
    or

    Code
    <tag>:
    <subtag_1>: <value>
    <subtab_2>: <value>
    ...

    B) However, Player.getPermissionValue() filters out 'unknown' (to it) tag strings and returns null, even if the queried tag is actually present in the permission file. It even ignores documented tags of the first type, like group or chatprefix.


    It would be better if Player.getPermissionValue() would return the value of any tag in the permission file.
    ____________________


    Then, three collateral notes:


    1) While not strictly indispensable, it would be good to have some sort of guides line about custom tag naming; as this is done for the sake of plug-ins, there is the risk that two plug-ins require the same name for some permission tag, which is to be avoided.


    2) The current way of specifying a sub tag (for the example above, it would be tag_sub_tag_1 or tag_sub_tag_2) is a bit cumbersome and unintuitive. A more common format like tag.sub_tag_1 or tag/sub_tag_1 would be better.


    3) Finally a caveat. Currently the plug-ins are completely self-contained in their individual sub-folder. Would not this extension add external dependencies (in the permission group files) and risk to 'pollute' the server configuration files?

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!