casbin / Casbin.NET

An authorization library that supports access control models like ACL, RBAC, ABAC in .NET (C#)
https://casbin.org
Apache License 2.0
1.14k stars 110 forks source link

Handle paths with System.IO.Path #246

Closed LuisPodestaGrip closed 5 months ago

LuisPodestaGrip commented 2 years ago

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.

casbin-bot commented 2 years ago

@sagilio @xcaptain @huazhikui

hsluoyz commented 2 years ago

@sagilio

sagilio commented 2 years ago

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

hsluoyz commented 5 months ago

Closed as stale