TheHolyWaffle / TeamSpeak-3-Java-API

A Java wrapper of TeamSpeak's 3 server query API.
MIT License
306 stars 107 forks source link

[Feature] : permissions type #413

Open RMrenex opened 2 years ago

RMrenex commented 2 years ago

Hi, I wanted to ask you before doing this would it be appropriate to make an Enum for each permission to simplify the addition and removal of permissions?

To have something like this :

api.addClientPermission(I_CHANNEL_JOIN_POWER, value, false)`
rogermb commented 2 years ago

Hi @RMrenex! Thank you for offering to help work on this feature 😄

Adding a Permission enum or something to that effect sounds like a great idea, and it would fit perfectly in the existing API! You could even use the TS3Api's own getPermissions() method to get a list of all permissions (ID, name, and description) and generate the code from there 😃

Perhaps it would also be a good idea to capture whether we're dealing with a boolean or an integer permission in the code somehow, as this would allow us to do some range checks on value in the addXYZPermission methods. Do you agree?

RMrenex commented 2 years ago

Indeed it is a good idea to check the value type for a permission. I'll do it as soon as I have some time 🙂.