feat: check AccessPermission in multiple permissions (#1420)

This commit is contained in:
imp2002 2022-12-23 14:06:02 +08:00 committed by GitHub
parent 5d1548e989
commit b8b915abe1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -313,8 +313,9 @@ func CheckAccessPermission(userId string, application *Application) (bool, error
return true, err
}
enforcer := getEnforcer(permission)
allowed, err = enforcer.Enforce(userId, application.Name, "read")
break
if allowed, err = enforcer.Enforce(userId, application.Name, "read"); allowed {
return allowed, err
}
}
}
return allowed, err