Continued with clearing more of the team's requests

This commit is contained in:
Tiago Ribeiro
2024-10-28 15:35:57 +00:00
parent fa0c502467
commit ef857fee59
10 changed files with 70 additions and 19 deletions

View File

@@ -52,7 +52,7 @@ export function findAllowedEntitiesSomePermissions(user: User, entities: EntityW
export function doesEntityAllow(user: User, entity: EntityWithRoles, permission: RolePermission) {
if (["admin", "developer"].includes(user?.type)) return true
const userEntity = findBy(user.entities, 'id', entity.id)
const userEntity = findBy(user.entities, 'id', entity?.id)
if (!userEntity) return false
const role = findBy(entity.roles, 'id', userEntity.role)