mirror of
https://github.com/1f349/mjwt.git
synced 2024-12-22 15:34:08 +00:00
Filter permissions that match multiple wildcard inputs
This commit is contained in:
parent
82d4a4a414
commit
1792211ca2
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user