Filter permissions that match multiple wildcard inputs

This commit is contained in:
Melon 2024-02-14 20:04:55 +00:00
parent 82d4a4a414
commit 1792211ca2
Signed by: melon
GPG Key ID: 6C9D970C50D26A25

View File

@ -76,6 +76,16 @@ func (p *PermStorage) Search(v string) []string {
return a return a
} }
func (p *PermStorage) Filter(match []string) *PermStorage {
out := NewPermStorage()
for _, i := range match {
for _, j := range p.Search(i) {
out.Set(j)
}
}
return out
}
func (p *PermStorage) prepare(a []string) { func (p *PermStorage) prepare(a []string) {
for _, i := range a { for _, i := range a {
p.Set(i) p.Set(i)