Continued with clearing more of the team's requests
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user