Closed Lausebengel closed 1 year ago
Hello, I have an error with casbin.rs DefaultModel::from_file. Independently to what I change in the CSV-file I get this Error :
2023-07-25T10:21:05.763527Z ERROR e_label_api: Failed to load casbin model: "Casbin Io Error: Custom { kind: Other, error: \"parse content error, line=p,*,/api/login,POST\" }"
Custom { kind: Other, error: \"parse content error, line=p,*,/api/login,POST\" }
It occurs in my main.rs file in the place where I call DefaultModel::from_file with the path to my CSV-file ( The file exists and is accessible).
This is the CSV-file content:
p,*,/api/login,POST p,*,/api/register,POST p,User,/api/addresses,GET p,Admin,/api/*,(GET)|(POST)
This is the model:
[request_definition] r = sub, obj, act [policy_definition] p = sub, obj, act [role_definition] g = _, _ [policy_effect] e = some(where (p.eft == allow)) [matchers] m = (g(r.sub, p.sub) || p.sub == "*") && keyMatch(r.obj, p.obj) && regexMatch(r.act, p.act)
It worked some hours ago and now I get this error.
Thanks in advance for any advice how to solve this.
Easy solution: I accidentally loaded the CSV file as the model ...
@oliver13 plz close the issue if resolved
Hello, I have an error with casbin.rs DefaultModel::from_file. Independently to what I change in the CSV-file I get this Error :
2023-07-25T10:21:05.763527Z ERROR e_label_api: Failed to load casbin model: "Casbin Io Error:
Custom { kind: Other, error: \"parse content error, line=p,*,/api/login,POST\" }
"It occurs in my main.rs file in the place where I call DefaultModel::from_file with the path to my CSV-file ( The file exists and is accessible).
This is the CSV-file content:
This is the model:
It worked some hours ago and now I get this error.
Thanks in advance for any advice how to solve this.