LuckPerms

LuckPerms

41.4k Downloads

Filter for lists from commands

haloflooder opened this issue ยท 2 comments

commented

Description

It would be very useful to be able to filter the list from permission/parent/etc info command. Would especially be very useful for filtering the context server=<server-id>

Proposed behaviour

Default behavior (no filter)

Lets say executing the command /lp group foobar permission info shows

[LP] foobar's Permissions: (page 1 of x - x entries)
> example1 (server="server1") (world="world")
> example6 (server="server2") (world="world")
> example2 (server="server2")
> example3 (server="server3")
> example4
> example5

Filters

Now, with a filter. Maybe it should be similar to how bulk editing does it's constraints. So it would display something like this if you execute /lp group foobar permission info filter "server == server2"

[LP] foobar's Permissions: (page 1 of 29 - 539 entries)
> example6 (server="server2") (world="world")
> example2 (server="server2")
> example4
> example5

But not sure if it should include global items by default.

Maybe you can display globals by using /lp group foobar permission info filter "server == server2" "global"

commented

I'm quite reluctant to add more filters to these commands - they already have sorting flags etc! It gets a bit complex to maintain when there's so much going on.

Perhaps if I were able to refactor it into something a bit more generic it could be do-able

commented

Just been asking about this is in the Discord server, and then checked here...
Definitly would love to see a Filter command as above where I can use it to check if a user has a group and then let them access something according to it!

Using a CommandSign to check if user has a specific rank/group and then allowing the command to run if they do.
That would be amazing !