Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

automatic parameterized registration of plugin derived permission sets #3681

Closed
PaxJaromeMalues opened this issue May 10, 2022 · 5 comments
Closed
Labels
status: needs triage This label is automatically applied to new issues and pull requests to indicate they require triage type: feature request A feature request

Comments

@PaxJaromeMalues
Copy link

Is this request specific to one implementation of Sponge?

Yes, only SpongeForge

Sponge Version

1.12.2 7.4.7

What are you requesting?

Currently, the only way to get a (semi) complete list of permissions is to create a dummy user and assign all available permissions to it manually or running lp tree (in case of luckperms) after the server has been up for a long time.

It would be nice if (maybe also for API7.4) a functionality could be introduced, that automatically fetches all non argument based permission nodes and make them available as a list-file, callrequest or dbentry to the server admins.

@PaxJaromeMalues PaxJaromeMalues added status: needs triage This label is automatically applied to new issues and pull requests to indicate they require triage type: feature request A feature request labels May 10, 2022
@ejm
Copy link

ejm commented May 10, 2022

This likely makes more sense as an issue for SpongeAPI rather than the Sponge repository, as it would be exposing functionality to developers

@PaxJaromeMalues
Copy link
Author

This likely makes more sense as an issue for SpongeAPI rather than the Sponge repository, as it would be exposing functionality to developers

damn, you right

@dualspiral
Copy link
Contributor

dualspiral commented May 10, 2022

I commented on the API issue (SpongePowered/SpongeAPI#2427), but for completeness...

For what it's worth, this is actually very much an impl request, not an API. The ask here is to enable dumping all known permissions, which is an implementation thing - though there is an element of truth to developers being able to register known permissions (which an API for already exists - PermissionDescription on the PermissionService).

Thing is, the implementation request is wasted here. Sponge (generally) does not control permissions, that's down to a plugin. Equally, Sponge or other plugins cannot magically know what permissions exist on the server ahead of time without plugins registering the descriptions. The API already exists for plugins to register ahead of time - so for what you want:

  • Permission plugin developers need to implement the PermissionDescription part of the permissions service (LuckPerms does this)
  • They need to support printing out all known plugins (LuckPerms also does this)
  • Other plugins that use permissions need to supply their permissions as PermissionDescriptions - most plugins don't do this

Sponge has no role to play here - for your problem it sounds like you need to talk to plugin developers who don't use the PermissionDescription API, not us, because ultimately, we don't control the permission side of things unless there is no permissions plugin, then we just do op based permissions.

Now, all that said, there are scenarios where permissions cannot be known ahead of time. Take permissions that incorporate the world, x.y.<worldname>, where the permission signifies a target world (that is, can't otherwise be determined by standard contexts). How can a plugin know ahead of time that the permission might be needed? It can't! So to magically dump out all permissions is really a fools errand - some permissions cannot be determined ahead of use time.

TL; DR: plugin developers need to register them, we, and permissions plugins, can't magically know everything if they don't tell us. Sponge can't do anything here.

@PaxJaromeMalues
Copy link
Author

I commented on the API issue (SpongePowered/SpongeAPI#2427), but for completeness...

For what it's worth, this is actually very much an impl request, not an API. The ask here is to enable dumping all known permissions, which is an implementation thing - though there is an element of truth to developers being able to register known permissions (which an API for already exists - PermissionDescription on the PermissionService).

Thing is, the implementation request is wasted here. Sponge (generally) does not control permissions, that's down to a plugin. Equally, Sponge or other plugins cannot magically know what permissions exist on the server ahead of time without plugins registering the descriptions. The API already exists for plugins to register ahead of time - so for what you want:

  • Permission plugin developers need to implement the PermissionDescription part of the permissions service (LuckPerms does this)
  • They need to support printing out all known plugins (LuckPerms also does this)
  • Other plugins that use permissions need to supply their permissions as PermissionDescriptions - most plugins don't do this

Sponge has no role to play here - for your problem it sounds like you need to talk to plugin developers who don't use the PermissionDescription API, not us, because ultimately, we don't control the permission side of things unless there is no permissions plugin, then we just do op based permissions.

Now, all that said, there are scenarios where permissions cannot be known ahead of time. Take permissions that incorporate the world, x.y.<worldname>, where the permission signifies a target world (that is, can't otherwise be determined by standard contexts). How can a plugin know ahead of time that the permission might be needed? It can't! So to magically dump out all permissions is really a fools errand - some permissions cannot be determined ahead of use time.

TL; DR: plugin developers need to register them, we, and permissions plugins, can't magically know everything if they don't tell us. Sponge can't do anything here.

Thank you for the detailed analysis.

So forcing permissionDescription ain't a thing as well, because Sponge can not know.
That's kinda a dead end. Sad face.

Is it possible to make the addition of permissionDescription for the Devs more attractive? Like priority plugin checks or something?

@dualspiral
Copy link
Contributor

In API-8, descriptions are intended to be used as "role templates", basically plugin defined groups that you can apply to other groups etc. In 7, that's not gonna happen now.

That said, how these descriptions are used is up to the permission plugin in question. If they make it compelling to use that function, plugins may follow suit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This label is automatically applied to new issues and pull requests to indicate they require triage type: feature request A feature request
Projects
None yet
Development

No branches or pull requests

3 participants