Skip to content

🐛 fix: update permission path in AddPermissionForUser method #269

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

Merged
merged 1 commit into from
May 6, 2025

Conversation

lwnmengjing
Copy link
Member

Description

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also note any relevant details for your test configuration.

  • Test A
  • Test B

Test Configuration:

  • Firmware version:
  • Hardware:
  • Toolchain:
  • SDK:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@lwnmengjing lwnmengjing requested a review from Copilot May 6, 2025 11:24
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug in the permission setup by updating the parameter used in the AddPermissionForUser method from the child menu’s Name to its Path.

  • Updated the API permission call to use the correct menu path.
Comments suppressed due to low confidence (1)

apis/role.go:154

  • The update changes the parameter from 'Name' to 'Path', which should now correctly represent the API endpoint. Please ensure that 'menus[i].Children[j].Path' is reliably populated and consider adding validation or appropriate error handling if there's any chance it might be empty.
req.RoleID, pkg.APIAccessType.String(), menus[i].Children[j].Path, menus[i].Children[j].Method

Copy link

github-actions bot commented May 6, 2025

Field Coverage
total: 4.0%

@lwnmengjing lwnmengjing merged commit c1715e3 into main May 6, 2025
1 check passed
@lwnmengjing lwnmengjing deleted the fix/access branch May 6, 2025 11:29
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.

2 participants