fix
This commit is contained in:
@@ -5,8 +5,11 @@ import (
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type LdapOptions struct {
|
||||
}
|
||||
|
||||
// 验证权限
|
||||
func (l *Ldap) VerifyAuthority(r *http.Request) bool {
|
||||
func (l *Ldap) VerifyAuthority(r *http.Request, options ...string) bool {
|
||||
token := r.Header.Get("Ldap-Authorization")
|
||||
info, err := l.ParseJwtToken(token, l.jwtSecret)
|
||||
if err != nil {
|
||||
@@ -21,6 +24,12 @@ func (l *Ldap) VerifyAuthority(r *http.Request) bool {
|
||||
if userInfo.Status != 1 {
|
||||
return false
|
||||
}
|
||||
// TODO 查询权限组相关信息
|
||||
if len(options) == 0 {
|
||||
return true
|
||||
}
|
||||
// todo 获取分组信息
|
||||
/*for _, option := range options {
|
||||
|
||||
}*/
|
||||
return true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user