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 Request: auto_properties should accept array when adding and removing roles #41

Closed
C-Oliver opened this issue Mar 3, 2023 · 2 comments
Assignees
Labels
accepted This issue was accepted, we will work on this at some point enhancement New feature or request In progress ui

Comments

@C-Oliver
Copy link

C-Oliver commented Mar 3, 2023

Is your feature request related to a problem? Please describe.
When setting users to "custom" and manually adding roles back in based on groups, using the "type: role" we should be able to specify an array of values instead of copy pasting the field and changing the role value, this should also be an option for removing roles. As it stands if we want to add or remove roles we need to create a new field group with patterns, type and value, as it only accepts a keyword value.

eg:

            - field: groups
              pattern: ^pattern1$
              type: role
              value: alert_manage

            - field: groups
              pattern: ^pattern1$
              type: role
              value: alert_view

            - field: groups
              pattern: ^pattern1$
              type: role
              value: apikey_access

            - field: groups
              pattern: ^pattern1$
              type: role
              value: file_detail

Describe the solution you'd like

            - field: groups
              pattern: ^pattern1$
              type: role
              value: [file_detail, apikey_access, alert_view, alert_manage]

Describe alternatives you've considered

When trying the above exceptions is thrown;

raise ValueError(f"[{self.name or self.parent_name}] {value} not in the possible values: { self.values}")\nValueError: [roles] ['alert_manage', 'alert_view', 'apikey_access', 'file_detail', 'heuristic_view', 'obo_access', 'replay_trigger', 'safelist_view', 'safelist_manage', 'signature_view', 'signature_download', 'submission_create', 'submission_delete', 'submission_manage', 'submission_view', 'workflow_manage', 'workflow_view', 'replay_system', 'archive_view', 'archive_manage', 'archive_trigger', 'self_manage'] not in the possible values: {'bundle_download', 'signature_ import', 'signature_download', 'file_download', 'submission_view', 'self_manage', 'alert_manage', 'signature_manage', 'administration', 'archive_download', 'replay_system', 'replay_trigger', 'alert_view', 'apikey_access', 'workflow_manage', 'heuristic_view', 'submission_manage', 'safelist_view', 'archive_view', 'workflow_view', 'submission_delete', 'submission_create', 'safelist_manage', 'signature_view', 'archive_trigger', 'obo_access', 'file_detail', 'archive_manage'}\n"}

The same is true if we try:

            - field: groups
              pattern: ^pattern1$
              type: role
              value: file_detail, apikey_access, alert_view, alert_manage

or

            - field: groups
              pattern: ^pattern1$
              type: role
              value: ["file_detail", "apikey_access", "alert_view", "alert_manage"]

or

            - field: groups
              pattern: ^pattern1$
              type: role
              value: 
                   -  "file_detail"
                   -  "apikey_access"
                   -  "alert_view"
                   - "alert_manage"

Additional context
unless I'm doing something wrong here I think collections of roles are not allowed.

Similar issue on the documentation as seen below:

image

@C-Oliver C-Oliver added assess We still haven't decided if this will be worked on or not enhancement New feature or request labels Mar 3, 2023
@cccs-sgaron
Copy link
Collaborator

This was a bug in the documentation. It was showing arrays where there shouldnt be. Altho, this is a good idea and we will look at implementing this.

@cccs-sgaron cccs-sgaron added accepted This issue was accepted, we will work on this at some point and removed assess We still haven't decided if this will be worked on or not labels Mar 3, 2023
@cccs-kevin cccs-kevin added the ui label May 16, 2023
@cccs-sgaron
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted This issue was accepted, we will work on this at some point enhancement New feature or request In progress ui
Projects
None yet
Development

No branches or pull requests

5 participants