refactor: optimize the code to getEnforcer (#2120)

This commit is contained in:
Yaodong Yu
2023-07-24 14:02:34 +08:00
committed by GitHub
parent b7a37126ad
commit 3c4112dd44
3 changed files with 59 additions and 40 deletions

View File

@ -161,5 +161,8 @@ func modelChangeTrigger(oldName string, newName string) error {
}
func HasRoleDefinition(m model.Model) bool {
if m == nil {
return false
}
return m["g"] != nil
}