Skip to content

Bugfix load policies as they were saved even with commas - #12

Merged
favipcj merged 2 commits into
ScienceLogic:masterfrom
favipcj:bugfix-load-policies-as-they-were-saved-even-with-commas
Feb 23, 2026
Merged

favipcj merged 2 commits into
ScienceLogic:masterfrom
favipcj:bugfix-load-policies-as-they-were-saved-even-with-commas

Conversation

@favipcj

@favipcj favipcj commented Feb 23, 2026 •

Copy link
Copy Markdown
Contributor

This is to cover possible scenarios in which a policy could contain a comma that is not a delimiter

If comma was set as delimiter, it's expected that the policy values were split by a comma. But to avoid this kind of scenarios apache/casbin-pycasbin#292 in which logic had to be added to escape or validated how the policy needs to be split, we can load the policies as they were saved into the database.

That is why this was submitted as a bugfix, as currently the following scenarios is happening:

  • The process to save the policies is working as expected, all the fields were saved into a different values like for example: values = ["name, surname", "another_value"]
  • When loading those values, we actually had a the following "name, surname, another_value" when requesting data for get_grouping_policy or get_roles_for_user, which was of course returning incorrect values

@favipcj
favipcj requested a review from jessecooper February 23, 2026 17:12

@jessecooper jessecooper left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM;

@favipcj
favipcj merged commit f3b1871 into ScienceLogic:master Feb 23, 2026
1 check passed
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