PermissionAPI Replacement #93
Pinned
TheMeinerLP
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Intro
In the past you could check in Minestom with
Player#hasPermission(String)
if the player or entity has the rights.Problem
There have been discussions that some like to use enum values for permissions and others want to use int values and the next one a string again.
If you want to combine multiple permission systems, the current system is too static.
As a result, the upstream has decided to remove the Permission API (Minestom#2302)
This is a disadvantage for our community, even if it is small.
Solution
In order to solve this problem more technically, we came up with an idea.
We build a permission registry that can combine several permission systems into one. Each developer has the choice of how the best permission system looks from his definition.
Some want to have enum values, others with strings, or others with whole class structures or instances.
In order to realize this, I have prepared a mock-up, which you can view here:
The solution offers every developer the opportunity to integrate their own solution and even address different transmitters. In addition, the API is hardened and yet modularly expandable.
The goal ...
... was to offer a pure API that is intended as a framework in the server for checking permissions, and only the manager instance is addressed internally. The actual checks are then carried out by the developer, and only the internal interface interlocking is then used by the framework.
Current status/draft PR
Soon
Proposal / Future Changes / Missing features
Feedback
This introduction to the system is intended to stimulate discussion and lead to an exchange of opinions!
Beta Was this translation helpful? Give feedback.
All reactions