TeamSpeak-3-Java-API icon indicating copy to clipboard operation
TeamSpeak-3-Java-API copied to clipboard

[Feature] : permissions type

Open RMrenex opened this issue 2 years ago • 2 comments

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)`

RMrenex avatar May 27 '22 16:05 RMrenex

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?

rogermb avatar May 29 '22 19:05 rogermb

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 🙂.

RMrenex avatar May 29 '22 20:05 RMrenex