speckleworks/SpeckleServer

Nulls in canWrite/canRead make permission checks fail

Closed this issue · 0 comments

Step 0:

Expected Behaviour

How things should actually work!

Nulls should not make the permission check routine fail and panic. Moreover, we should not be able to introduce nulls in the first place in the canRead and canWrite arrays of a resource.

Actual Behaviour

What's actually going on!

If encountering a null, the permission checking middleware freaks out and throws an error.

Affected Projects

Does this issue propagate to other dependencies or dependants? If so, list them here!

SpeckleAdmin seems to introduce this nulls - not sure - via fast clicking the buttons.

Proposed Solution (if any)

  • Sanitise permission checking middleware to ignore nulls
  • Sanitise API to clean nulls from canRead and canWrite arrays on entry.