Skip to content

Commit

Permalink
fix line=''
Browse files Browse the repository at this point in the history
  • Loading branch information
qiangmzsx committed Mar 23, 2018
1 parent db5f14e commit 38f2530
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ func (sa *Adapter) LoadPolicy(model model.Model) error {
}
strs := strings.Split(sa.Line, "\n")
for _, str := range strs {
if str=="" {
continue
}
persist.LoadPolicyLine(str, model)
}

Expand Down
2 changes: 1 addition & 1 deletion adapter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ g, alice, data_group_admin
sa := NewAdapter(line)
e := casbin.NewEnforcer(casbin.NewModel(conf), sa)
sub := "alice"
obj := "/alice_data1/login"
obj := "/alice_data/login"
act := "POST"
if e.Enforce(sub, obj, act) != true {
t.Error("**error**")
Expand Down

0 comments on commit 38f2530

Please sign in to comment.