权限管理接口实现
This commit is contained in:
@@ -113,8 +113,14 @@ func authBasic(_ context.Context, token string) (*AuthCtx, error) {
|
||||
return nil, fmt.Errorf("客户端认证失败:%w", err)
|
||||
}
|
||||
|
||||
scopes := []string{}
|
||||
if client.Permissions != nil {
|
||||
for _, p := range client.Permissions {
|
||||
scopes = append(scopes, p.Name)
|
||||
}
|
||||
}
|
||||
return &AuthCtx{
|
||||
Client: client,
|
||||
Scopes: []string{},
|
||||
Scopes: scopes,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user