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

Updating Policies directly on the IPolicyStore model not reflected in Enforcer #313

Closed
amopitt opened this issue Mar 24, 2023 · 4 comments
Closed
Assignees
Labels
question Further information is requested

Comments

@amopitt
Copy link

amopitt commented Mar 24, 2023

I am modifying the group policies dynamically listening to event messages using syntax below (this is on 2.0.0-preview.4, still need to update here):

    public static bool AddGroupPolicy(this IPolicyStore model, GroupPolicy policy)
    {
        return model.AddGroupPolicies(new[] { policy });
    }

I see that the PolicyManager reflects the changes, nothing errors. However when I call EnforceAsync I still get a Forbidden error. I am just asking generically is there something else that needs to be done that I am missing? AutoSave is set to true. Inspecting through breakpoints shows that my group policy is valid. If I were to call LoadPolicy on the exact same model it will then work as expected so something is off with what I'm doing.

@casbin-bot
Copy link
Member

@casbin-bot casbin-bot added the question Further information is requested label Mar 24, 2023
@sagilio
Copy link
Member

sagilio commented Apr 1, 2023

@amopitt It needs not some work else to do, I think the wrong may be caused by BuildIncrementalRoleLink or cache logic. Could you get me a sample or test to reproduce this case?

@hsluoyz
Copy link
Member

hsluoyz commented Jan 27, 2024

@amopitt any update?

@hsluoyz
Copy link
Member

hsluoyz commented Apr 4, 2024

Closed as stale.

@hsluoyz hsluoyz closed this as completed Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Development

No branches or pull requests

4 participants