Skip to content

Commit

Permalink
Fix bug authorize
Browse files Browse the repository at this point in the history
  • Loading branch information
minhduc140583 committed May 3, 2021
1 parent 24e3745 commit 0c24343
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sql/privilege_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,19 @@ func (l PrivilegeLoader) Privilege(ctx context.Context, userId string, privilege
return actionNone
}
defer rows.Close()
exist := false
for rows.Next() {
exist = true
var action int32
er1 := rows.Scan(&action)
if er1 != nil {
return actionNone
}
permissions = permissions | action
}
if !exist {
return actionNone
}
if permissions == actionNone {
return actionAll
}
Expand Down

0 comments on commit 0c24343

Please sign in to comment.