Skip to content

Bugfix on ACLs #1242

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 3 commits into from
Mar 27, 2025
Merged

Bugfix on ACLs #1242

merged 3 commits into from
Mar 27, 2025

Conversation

tomchop
Copy link
Collaborator

@tomchop tomchop commented Mar 27, 2025

  • Return all ACLs by default (useful when checking)
  • Have an option to only return default ACLs (useful when editing)
  • Add a test

@tomchop tomchop requested a review from Copilot March 27, 2025 15:35
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 ACL handling by returning all ACLs by default while adding an option to retrieve only default ACLs, and includes new tests to verify the behavior.

  • Updated test data and added a new test (test_get_acls) in tests/schemas/rbac.py
  • Modified ACL retrieval in core/web/apiv2/rbac.py and core/schemas/model.py to support a "direct" option
  • Updated dfiq logic in core/schemas/dfiq.py to initialize ACLs via rbac.set_acls

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/schemas/rbac.py Updated user, group, and entity names; added a new test to verify ACL retrieval
core/web/apiv2/rbac.py Modified get_acl_details to retrieve ACLs using the new direct parameter
core/schemas/model.py Updated get_acls to support a direct parameter, affecting the traversal logic
core/schemas/dfiq.py Added call to rbac.set_acls during dfiq object processing to ensure ACLs are set

@tomchop tomchop merged commit 0cc1f3c into main Mar 27, 2025
2 checks passed
@tomchop tomchop deleted the aclbugfix branch March 27, 2025 15:51
@tomchop tomchop added the bug label Mar 27, 2025
Copy link
Collaborator

@udgover udgover left a comment

Choose a reason for hiding this comment

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

one small nit other than that LGTM.

@@ -96,18 +96,19 @@ def __init__(self, **data):
def acls(self):
return self._acls

def get_acls(self) -> None:
def get_acls(self, direct=False) -> None:
"""Returns the permissions assigned to a user.
Args:
user: The user to check permissions for.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Looks like Args documentation are no longer relevant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants