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

[Feature] : permissions type #413

Open
RMrenex opened this issue May 27, 2022 · 2 comments
Open

[Feature] : permissions type #413

RMrenex opened this issue May 27, 2022 · 2 comments

Comments

@RMrenex
Copy link
Contributor

RMrenex commented May 27, 2022

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
Copy link
Collaborator

rogermb commented May 29, 2022

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
Copy link
Contributor Author

RMrenex commented May 29, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants