mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 12:40:07 +00:00
feat: user roles (#852)
* [WIP] feat: user roles * update * update * admin handler * update * feat: user-specific connection secret * simplify some logics * cleanup * update waf * update user api error handling * update waf api * fix codeql * update waf table * fix several problems * add pagination for waf api * update permission checks * switch to runtime check * 1 * cover? * some changes
This commit is contained in:
@@ -3,10 +3,12 @@ package utils
|
||||
import (
|
||||
"crypto/rand"
|
||||
"errors"
|
||||
"maps"
|
||||
"math/big"
|
||||
"net/netip"
|
||||
"os"
|
||||
"regexp"
|
||||
"slices"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
@@ -145,3 +147,8 @@ func Itoa[T constraints.Integer](i T) string {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
func MapValuesToSlice[Map ~map[K]V, K comparable, V any](m Map) []V {
|
||||
s := make([]V, 0, len(m))
|
||||
return slices.AppendSeq(s, maps.Values(m))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user