feat: complete pet SOP governance workflow

This commit is contained in:
Eric 1549169735@qq.com
2026-08-08 22:58:35 +08:00
parent 97a76250f7
commit 4b240499c2
85 changed files with 1316 additions and 269 deletions

View File

@@ -0,0 +1,19 @@
package auth
func HasPermission(principal Principal, permission string) bool {
for _, allowed := range principal.Permissions {
if allowed == "*" || allowed == permission {
return true
}
}
return false
}
func HasAnyPermission(principal Principal, permissions ...string) bool {
for _, permission := range permissions {
if HasPermission(principal, permission) {
return true
}
}
return false
}