fix: 🐛 handle missing principals array in role response

This commit is contained in:
Randall Morey committed 2020-09-12 11:40:21 -04:00
1 parent 048e202343
commit bcd46cec1f
6 files changed
+39 -7

No files matched your search

+4 -1
View File
@@ -12,7 +12,10 @@ export default class RoleModel extends GeneratedRoleModel {
* see obvious. Instead, the application layer is expected to load referenced
* users and groups as needed.
*/
@fragmentArray('fragment-principal', {readOnly: true}) principals;
@fragmentArray('fragment-principal', {
readOnly: true,
emptyArrayIfMissing: true
}) principals;
/**
* Grants is read-only _most_ under normal circumstances. But grants can