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: Rbac not working for resources having long names #3370

Merged
merged 4 commits into from
May 11, 2023

Conversation

prakash100198
Copy link
Contributor

Description

When we set permission group for a resource with long name (length>100) the role group was not getting stored in the casbin_rules and roles table in orch database, hence RBAC was not working in that case, this pr fixes that issue.
Fixes #3078

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
This has been tested by deploying the fixed code image into my cluster having SSO configured.
Test Scenarios:-

  1. Add user and assign permission to the user for that resource with the long name, now add this permission group to that user and check for that user if that kubernetes resource is visible or not.
  2. Check my making different combinations of permission roles and assign to the user, and check if resource is visible or not.

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR requires documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have tested it for all user roles.
  • I have added all the required unit/api test cases.

Does this PR introduce a user-facing change?


@prakash100198 prakash100198 requested review from vikramdevtron, nishant-d and kartik-579 and removed request for vikramdevtron May 10, 2023 14:42
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@prakash100198 prakash100198 merged commit 8828cd6 into main May 11, 2023
@prakash100198 prakash100198 deleted the unable-to-set-permission-for-long-resource-name branch May 11, 2023 13:18
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.

Bug: User Permission not showing when resource name is too long.
2 participants