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

proposal: an improved permissions system #530

Open
harry-xi opened this issue Dec 25, 2024 · 0 comments
Open

proposal: an improved permissions system #530

harry-xi opened this issue Dec 25, 2024 · 0 comments
Labels
Proposal Some important decisions

Comments

@harry-xi
Copy link
Contributor

harry-xi commented Dec 25, 2024

Why

The current permissions system can provide enough functionality to check and monitor the permissions of objects, but no one can know what permissions exist and what they are used for. So it is nearly impossible for anyone to manage permissions by hand, or to write a plugin to manage all permissions. So I think we can make some improvements.

How

Provide a mechanism to register permissions and record all permissions in this way.
For a better user experience and to reduce the magnitude of API changes (if they are really needed) I would suggest providing the following two permission registration methods

  1. direct registration: add permissions directly to the registry, where it is supported to provide information such as a description of the permission.
  2. registration in the method that gets the permission instance
Perm perm = Perm.of("aaa.bbb.ccc");

Use this as both a way to register and get an instance of the permission; if it exists, get the instance, and if it doesn't, register the permission
(in fact it can be used as an overload of the existing addPermission)

Some additions: This second route is primarily intended for permissions that are added or assigned when the server is initialized, and should not be used for runtime permission changes.

@harry-xi harry-xi added the Proposal Some important decisions label Dec 25, 2024
@smartcmd smartcmd changed the title An improved permissions system proposal: an improved permissions system Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Proposal Some important decisions
Projects
None yet
Development

No branches or pull requests

1 participant