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

Support custom user roles in commands with --role option #269

Open
pederhan opened this issue Dec 4, 2024 · 0 comments
Open

Support custom user roles in commands with --role option #269

pederhan opened this issue Dec 4, 2024 · 0 comments

Comments

@pederhan
Copy link
Member

pederhan commented Dec 4, 2024

It is possible to create custom user roles in Zabbix. Zabbix-CLI currently has a hard time utilizing these roles, because in commands where we expect a user role argument, we check for valid values using an enum (UserRole). It would be nice if we could keep the user, admin, superadmin, guest choices in the command help while still supporting custom roles.

One way to do this is to do away with the enum as the parameter type and instead make it a string parameter, and then inside the command pass it to some parsing function that tries to parse the value as a UserRole, and failing that, attempts to fetch the custom user role to see if it exists. This requires us to manually document the various predefined roles (user, admin, superadmin, guest) in the command docs, either in the main help text or via examples.

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

1 participant