mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-03 12:30:19 +08:00
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:
@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user