fix
This commit is contained in:
parent
760d9928dc
commit
9cb54041cd
|
@ -5,11 +5,21 @@ import (
|
|||
"net/http"
|
||||
)
|
||||
|
||||
type LdapVerifyType string
|
||||
|
||||
const (
|
||||
API_PATH LdapVerifyType = "api_path"
|
||||
MENU_PATH LdapVerifyType = "menu_path"
|
||||
)
|
||||
|
||||
type LdapOptions struct {
|
||||
Type LdapVerifyType
|
||||
Value string
|
||||
}
|
||||
|
||||
// 验证权限
|
||||
func (l *Ldap) VerifyAuthority(r *http.Request, options ...string) bool {
|
||||
func (l *Ldap) VerifyAuthority(r *http.Request, options ...LdapOptions) bool {
|
||||
return true
|
||||
token := r.Header.Get("Ldap-Authorization")
|
||||
info, err := l.ParseJwtToken(token, l.jwtSecret)
|
||||
if err != nil {
|
||||
|
@ -27,9 +37,5 @@ func (l *Ldap) VerifyAuthority(r *http.Request, options ...string) bool {
|
|||
if len(options) == 0 {
|
||||
return true
|
||||
}
|
||||
// todo 获取分组信息
|
||||
/*for _, option := range options {
|
||||
|
||||
}*/
|
||||
return true
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user