feat: gracefully handle missing objects
This commit is contained in:
parent
c921ea6eb7
commit
649ab26da8
@ -89,6 +89,10 @@ const checkAuthorizationByTypes = {
|
||||
// Hoisting is important for this function.
|
||||
function checkAuthorization (objectId, permission) {
|
||||
const object = getObject(objectId)
|
||||
if (!object) {
|
||||
return false
|
||||
}
|
||||
|
||||
const checker = checkAuthorizationByTypes[object.type] || checkSelf
|
||||
|
||||
return checker(object, permission)
|
||||
|
Loading…
Reference in New Issue
Block a user