From 1792211ca2e778a2b0ce17f41f02ddbc80fe0a7e Mon Sep 17 00:00:00 2001 From: MrMelon54 Date: Wed, 14 Feb 2024 20:04:55 +0000 Subject: [PATCH] Filter permissions that match multiple wildcard inputs --- claims/perms.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/claims/perms.go b/claims/perms.go index 7409e83..861963b 100644 --- a/claims/perms.go +++ b/claims/perms.go @@ -76,6 +76,16 @@ func (p *PermStorage) Search(v string) []string { 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) { for _, i := range a { p.Set(i)