权限管理接口实现

This commit is contained in:
2026-03-18 18:09:32 +08:00
parent 9d996acf5f
commit bb895eccdf
44 changed files with 1958 additions and 161 deletions

View File

@@ -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
}