feat: support checking permissions for group roles (#2422)

* fix(permission): fix CheckLoginPermission() logic

* style: fix code format

* feat: support settting roles for groups

* fix: fix field name

* style: format codes

---------

Co-authored-by: aidenlu <aiden_lu@wochacha.com>
This commit is contained in:
aiden
2023-10-19 15:33:45 +08:00
committed by GitHub
parent 3f53591751
commit 45db4deb6b
3 changed files with 32 additions and 4 deletions

View File

@ -60,3 +60,19 @@ func ReturnAnyNotEmpty(strs ...string) string {
}
return ""
}
func HaveIntersection(arr1 []string, arr2 []string) bool {
elements := make(map[string]bool)
for _, str := range arr1 {
elements[str] = true
}
for _, str := range arr2 {
if elements[str] {
return true
}
}
return false
}