Casbin.NET icon indicating copy to clipboard operation
Casbin.NET copied to clipboard

Handle paths with System.IO.Path

Open LuisPodestaGrip opened this issue 3 years ago • 3 comments

The path variables in the Enforcer constructor handle everything as relative paths.

This change will help to use files from cloud storage or other sources that isn't in the project folder.

LuisPodestaGrip avatar Mar 04 '22 12:03 LuisPodestaGrip

@sagilio @xcaptain @huazhikui

casbin-bot avatar Mar 04 '22 12:03 casbin-bot

@sagilio

hsluoyz avatar Mar 04 '22 13:03 hsluoyz

I have written a simple test for this issue, lt may already support relative paths. Could you write a sample unit test for your case?

[Fact]
public void TestEnforceWithRelativePath()
{
    var e = new Enforcer("./examples/basic_model.conf");
    Assert.NotNull(e.GetModel());
}

image

sagilio avatar Mar 11 '22 14:03 sagilio

Closed as stale

hsluoyz avatar Jan 27 '24 12:01 hsluoyz