atomicdata-dev / atomic-data-docs

Atomic Data is a specification to make it easier to exchange data.
https://docs.atomicdata.dev
MIT License
17 stars 7 forks source link

Public resources that should not be publicly searchable - non-index, show-on-open permissions #88

Open joepio opened 2 years ago

joepio commented 2 years ago

Some resources, such as Invites, should be openable by their public URL, but should not be visible in public indexes.

If you open the Invites collection, you should not see Invites that are created in private for specific users. But if someone opens the Invite URL, they must not get a 403.

So how do we deal with this? What changes do we need in the Authorization model?

Add a readOnOpen permission

We have a read permission. We could add a readOnOpen permission. When performing a Query (e.g. when opening a collection, or performing a fulltext search) we check for show, not readOnOpen. However, if we directly open the resource, we will check readOnOpen, which also is true when read is true.

Alternative names:

Add an index permission

We add canIndex check in the back-end, which works similar to canRead and canWrite. They iterate over parents and use hierarchy to check if an item can be indexed.