[SPIGOT-5944] Allow for multiple permissions to be set for autocomplete Created: 05/Jul/20  Updated: 05/Jul/20

Status: Open
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Minor
Reporter: Nikan Radan Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: Feature, Improvment, Suggestion, feature, improvement, needed, suggestion

Version: 1.16.1-R0.1-SNAPSHOT
Guidelines Read: Yes

 Description   

Currently you can register a command and have it autofill depending on if the user has a single permission which is a huge inconvenience. An example of this is:

commands:
  heal:
    description: This will heal you.
    permission:
      first_plugin.commands.heal.self

but the issue with this is that it should instead take in acceptable permission combination conditions an example on how this would be done would be like so:

commands:
  heal:
    description: This will heal you.
    permissions:
      [first_plugin.commands.heal.self, first_plugin.commands.heal.others]

In this example if the player has either one of those permissions it'll autocomplete with tab but we're still missing some needed functionality so let's so deeper:

commands:
  heal:
    description: This will heal you.
    permissions:
      [
        [first_plugin.commands.heal.self, first_plugin.has_clean_record],
        [first_plugin.commands.heal.others, first_plugin.has_clean_record]
      ]

In this example if either one of those permission combination conditions are met it'll autofill. The current way this is set up where only one permission can be put there for autocomplete doesn't cover what should be covered and something like this would be a major improvement.



 Comments   
Comment by Nikan Radan [ 05/Jul/20 ]

I think it's still something that should be implemented because creating extra permissions like that shouldn't be necessary for auto completion, it clutters the YAMAL and it gets super unreadable if you want to require a combination of permissions. My idea basically makes the permission field have the && and || abilities of an if statement if that puts it into perspective.

Comment by md_5 [ 05/Jul/20 ]

The first example I get, the second example with has_clean_record I really don't understand or see as useful.

That being said this problem is already solved by defining the relevant command permissions themselves as combinations of each other using children, eg (pardon the poor indention):

 commands:
  heal:
    description: This will heal you.
    permission: first_plugin.commands.heal
permissions:
    first_plugin.commands.heal.self
        children:
              first_plugin.commands.heal: true
    first_plugin.commands.heal.others
        children:
              first_plugin.commands.heal: true

In light of that is this feature still required?

Generated at Sat Dec 13 15:25:25 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.