puck icon indicating copy to clipboard operation
puck copied to clipboard

Issues with permissions docs

Open chrisvxd opened this issue 11 months ago • 1 comments

Observed some issues with the permissions docs:

  1. The permissions API reference is missing description and links for getPermissions and refreshPermissions APIs.
  2. The getPermissions API example says it must typically be wrapped in a useEffect as resolving dynamic permissions will update the reference, but it also says that calling it will resolve dynamic permissions. This implies it would create an infinite loop. Either the docs are bad, or the API is wrong. Needs investigation.

chrisvxd avatar Dec 30 '24 11:12 chrisvxd

Another issue with the permissions docs is that we don’t fully document which permissions are supported at each level. This could also be a problem with the permissions types, since we currently allow all permissions at all levels, even when some don’t apply:

  • We currently allow all permissions at the root config level, even though the only one that makes sense is edit (you can't delete, drag, insert, or duplicate the root).
  • resolvePermissions can return all permissions, but insert doesn’t make sense in that context. This is because resolvePermissions only applies to the instance where it's running, and in that case, the instance is already inserted, so disabling insert has no effect.

We should improve the documentation on this, and probably adjust the types to reflect these distinctions more clearly.

FedericoBonel avatar Nov 05 '25 03:11 FedericoBonel