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

Fix permissions for group edit buttons #7056

Merged
merged 6 commits into from
Oct 3, 2024

Conversation

Tostti
Copy link
Member

@Tostti Tostti commented Oct 2, 2024

Description

This PR fixes a bug on which different buttons on the Endpoint groups section showed as enabled even if the user had no permissions to use them

Issues Resolved

#7055

Evidence

image
image
image

Test

  • Generate an environment with a real manager and an agent
  • Follow the documentation.
  • Log in with the readonly user and navigate to Endpoint groups and verify that the pencil button in the Actions column is disabled
  • Click on a group and verify that on the Agents tab, the Manage agents button is disabled
  • Navigate to the Files tab and verify that the Edit group configuration button, as well as any pencil icon on the Actions column is disabled.
  • With an administrator user, repeat the previous steps and verify that the buttons work as expected

Note

It is important to verify that the API is set to run_as mode, and to make sure that the RBAC configuration is done with the manager API selected. It will not work with imposter.

Check List

  • All tests pass
    • yarn test:jest
  • New functionality includes testing.
  • New functionality has been documented.
  • Update CHANGELOG.md
  • Commits are signed per the DCO using --signoff

@Tostti Tostti self-assigned this Oct 2, 2024
asteriscos
asteriscos previously approved these changes Oct 3, 2024
Copy link
Member

@asteriscos asteriscos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR: 🟢
Test: 🟢

Peek 2024-10-03 11-43

Copy link
Contributor

github-actions bot commented Oct 3, 2024

Wazuh Core plugin code coverage (Jest) test % values
Statements 45.5% ( 400 / 879 )
Branches 41.09% ( 157 / 382 )
Functions 43.87% ( 136 / 310 )
Lines 45.69% ( 398 / 871 )

Copy link
Contributor

github-actions bot commented Oct 3, 2024

Wazuh Check Updates plugin code coverage (Jest) test % values
Statements 76.44% ( 172 / 225 )
Branches 58.65% ( 61 / 104 )
Functions 61.7% ( 29 / 47 )
Lines 76.44% ( 172 / 225 )

Copy link
Contributor

github-actions bot commented Oct 3, 2024

Main plugin code coverage (Jest) test % values
Statements 13.8% ( 4069 / 29477 )
Branches 9.16% ( 1765 / 19264 )
Functions 13.46% ( 959 / 7124 )
Lines 13.97% ( 3965 / 28363 )

Copy link
Member

@JuanGarriuz JuanGarriuz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!

Test 🟢

  • ReadOnly

image

  • Admin

image

CR 🟢

@asteriscos asteriscos merged commit c5823e1 into 4.9.1 Oct 3, 2024
5 checks passed
@asteriscos asteriscos deleted the bug/7055-disable-edit-button-readonly-user branch October 3, 2024 10:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Edit button active within Endpoint Groups page for a read-only Wazuh user
3 participants